You are reading a single comment by @ClearMemory041063 and its replies. Click here to read the full conversation.
  • This may help:
    https://www.espruino.com/Pico+Buttons
    Using the button and LED on the Pico

    clearWatch(); // remove our last watch
    setWatch(function(e) {
      digitalWrite(LED1, e.state);
      presses++;
      console.log("Pressed "+presses);
    }, BTN, { repeat: true, debounce : 50 });
    

    Now using Pin B4 instead of the button, connect one of the encoder output to pin B4 and the other common wire to ground.
    Use pinMode(B4,input_pullup)
    http://www.espruino.com/Reference#l__global_pinMode

    pinMode(B4,input_pullup);
    setWatch(function() {
      digitalPulse(LED2, 1, 50);
    }, B4, { repeat: true, debounce : 50, edge: "rising" }
    

    See if the LED blinks as you turn the shaft encoder

About