• Thanks for the PR!

    This is the first one I found when I just googled for rotary encoder: http://uk.rs-online.com/web/p/products/7­377767/

    I think it's like the one I have.

    It'd be great if you could look at it - your code was much tidier! Perhaps (to be backwards compatible) we could have:

    // original behviour
    require("Encoder").connect(A1,A2,functio­n (direction) { ... });
    
    // your behaviour
    require("Encoder").connect(A1,A2,{clicks­:2, callback:function (direction) { ... }});
    
    // other behaviour
    require("Encoder").connect(A1,A2,{clicks­:4, callback:function (direction) { ... }});
    
    

    Of course there might be a better name for it, but allowing the function to be changed to an object with extra parameters would be really good.

About

Avatar for Gordon @Gordon started