Skip to content

Pico Display 2.x: Fixed button function #1003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions micropython/examples/pico_display/scroll_menu_h.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Note: This example is intended for use on the Pico Display 2.0 and Pico Display 2.8
# and will not display correctly on the smaller Pico Display due to the difference in resolution.

# A scrolling menu example
# Use B and Y buttons to navigate LEFT and RIGHT
# Press A to select a character. Selected characters are shown at the top of the display.
Expand All @@ -8,10 +11,10 @@
from pimoroni import RGBLED
from machine import Pin

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

display = PicoGraphics(display=DISPLAY_PICO_DISPLAY_2, pen_type=PEN_RGB565, rotate=0)
display.set_backlight(0.8)
Expand Down
11 changes: 7 additions & 4 deletions micropython/examples/pico_display/scroll_menu_v.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Note: This example is intended for use on the Pico Display 2.0 and Pico Display 2.8
# and will not display correctly on the smaller Pico Display due to the difference in resolution.

# A scrolling menu example
# Use X and Y buttons to navigate up and down the menu
# Press A to select a character. Selected characters are shown at the bottom of the display.
Expand All @@ -8,10 +11,10 @@
from pimoroni import RGBLED
from machine import Pin

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

display = PicoGraphics(display=DISPLAY_PICO_DISPLAY_2, pen_type=PEN_RGB565, rotate=0)
display.set_backlight(0.8)
Expand Down