• OK thank you @Gordon

    the final solution was the pull_up

    function onInit() {
      var value = 0;
      pinMode(A8, 'input_pullup');
      pinMode(A5, 'input_pullup');
      setWatch(function(e) {
        if (e.data) value++ else value--;
        print(value);
        }, A5, {data:A8, repeat:true, edge:'falling'});
    }
    

    the value increases and decreases according to the rotation.

    é.

About

Avatar for Mrbbp @Mrbbp started