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
@ClearMemory041063 started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
This may help:
https://www.espruino.com/Pico+Buttons
Using the button and LED on the Pico
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
See if the LED blinks as you turn the shaft encoder