Pico_code
Pico_code copied to clipboard
Add pull-up for joystick/buttons
With the current demo, the joystick/button inputs are floating and will result in unreliable "flickering" of the red squares.
Pulling the GPIO pins up using Pin.PULL_UP will prevent this flickering. "Up", because looking at the schematic of the V2 version which I have, the buttons are switching to ground. Thus, requiring a pull-up resistor (built-in or not).
Also:
- Other boards might also benefit from this, but I only checked the schematic of the 1.14" board as that's the one I have;
- You might wanna fix the typo in the
Pico_coderepository, which currently is "Waveshrae Pico-OLED/LCD driver code" (notice the incorrect spelling of "Waveshare").
I had the same issue with the flickering, and using Pin.PULL_UP fixed it for me too!