• Hello,

    i'm playing with a rotary encoder a big MYSM60-100PPRR-5L with the example given
    but the console is populated with too many answer for 1 step.

    function onInit() {
      var step = 0;
      require("Encoder").connect(A5,A8, (dir) => {
        print(dir);
        if (dir > 0) {
          //allume la led 20ms
          digitalPulse(LED1, 1, 20);
        } else {
          digitalPulse(LED2, 1, 20);
        }
      });
    }
    

    console return for 1step backward

    -1
    -1
    -1
    -1
    -1
    1
    > 
    

    and

    1
    1
    1
    1
    > 
    

    for 1 step forward...

    what i'm doing badly?

About

Avatar for Mrbbp @Mrbbp started