From 0cd6872f8e51984ac98a13d6bfa98b46e81bbddd Mon Sep 17 00:00:00 2001 From: osirisinferi Date: Wed, 4 Sep 2024 20:49:53 +0200 Subject: [PATCH] Add pull-up for joystick/buttons --- Python/Pico-LCD-1.14/Pico-LCD-1.14.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Python/Pico-LCD-1.14/Pico-LCD-1.14.py b/Python/Pico-LCD-1.14/Pico-LCD-1.14.py index 15ee409..9b0477a 100644 --- a/Python/Pico-LCD-1.14/Pico-LCD-1.14.py +++ b/Python/Pico-LCD-1.14/Pico-LCD-1.14.py @@ -179,10 +179,10 @@ def show(self): LCD.rect(208,103,20,20,LCD.red) LCD.show() - key0 = Pin(15,Pin.IN) - key1 = Pin(17,Pin.IN) - key2 = Pin(2 ,Pin.IN) - key3 = Pin(3 ,Pin.IN) + key0 = Pin(15,Pin.IN, Pin.PULL_UP) + key1 = Pin(17,Pin.IN, Pin.PULL_UP) + key2 = Pin(2 ,Pin.IN, Pin.PULL_UP) + key3 = Pin(3 ,Pin.IN, Pin.PULL_UP) while(1): if(key0.value() == 0): LCD.fill_rect(12,12,20,20,LCD.red)