Skip to content

Commit 61ca10e

Browse files
committed
Pico Display 2.x: Fixed button function
1 parent 871399a commit 61ca10e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

micropython/examples/pico_display/scroll_menu_h.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
from pimoroni import RGBLED
99
from machine import Pin
1010

11-
button_a = Pin(12, Pin.IN)
12-
button_b = Pin(13, Pin.IN)
13-
button_x = Pin(14, Pin.IN)
14-
button_y = Pin(15, Pin.IN)
11+
button_a = Pin(12, Pin.IN, Pin.PULL_UP)
12+
button_b = Pin(13, Pin.IN, Pin.PULL_UP)
13+
button_x = Pin(14, Pin.IN, Pin.PULL_UP)
14+
button_y = Pin(15, Pin.IN, Pin.PULL_UP)
1515

1616
display = PicoGraphics(display=DISPLAY_PICO_DISPLAY_2, pen_type=PEN_RGB565, rotate=0)
1717
display.set_backlight(0.8)

micropython/examples/pico_display/scroll_menu_v.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
from pimoroni import RGBLED
99
from machine import Pin
1010

11-
button_a = Pin(12, Pin.IN)
12-
button_b = Pin(13, Pin.IN)
13-
button_x = Pin(14, Pin.IN)
14-
button_y = Pin(15, Pin.IN)
11+
button_a = Pin(12, Pin.IN, Pin.PULL_UP)
12+
button_b = Pin(13, Pin.IN, Pin.PULL_UP)
13+
button_x = Pin(14, Pin.IN, Pin.PULL_UP)
14+
button_y = Pin(15, Pin.IN, Pin.PULL_UP)
1515

1616
display = PicoGraphics(display=DISPLAY_PICO_DISPLAY_2, pen_type=PEN_RGB565, rotate=0)
1717
display.set_backlight(0.8)

0 commit comments

Comments
 (0)