File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed
micropython/examples/pico_display Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change
1
+ # Note: This example is intended for use on the Pico Display 2.0 and Pico Display 2.8
2
+ # and will not display correctly on the smaller Pico Display due to the difference in resolution.
3
+
1
4
# A scrolling menu example
2
5
# Use B and Y buttons to navigate LEFT and RIGHT
3
6
# Press A to select a character. Selected characters are shown at the top of the display.
8
11
from pimoroni import RGBLED
9
12
from machine import Pin
10
13
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 )
14
+ button_a = Pin (12 , Pin .IN , Pin . PULL_UP )
15
+ button_b = Pin (13 , Pin .IN , Pin . PULL_UP )
16
+ button_x = Pin (14 , Pin .IN , Pin . PULL_UP )
17
+ button_y = Pin (15 , Pin .IN , Pin . PULL_UP )
15
18
16
19
display = PicoGraphics (display = DISPLAY_PICO_DISPLAY_2 , pen_type = PEN_RGB565 , rotate = 0 )
17
20
display .set_backlight (0.8 )
Original file line number Diff line number Diff line change
1
+ # Note: This example is intended for use on the Pico Display 2.0 and Pico Display 2.8
2
+ # and will not display correctly on the smaller Pico Display due to the difference in resolution.
3
+
1
4
# A scrolling menu example
2
5
# Use X and Y buttons to navigate up and down the menu
3
6
# Press A to select a character. Selected characters are shown at the bottom of the display.
8
11
from pimoroni import RGBLED
9
12
from machine import Pin
10
13
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 )
14
+ button_a = Pin (12 , Pin .IN , Pin . PULL_UP )
15
+ button_b = Pin (13 , Pin .IN , Pin . PULL_UP )
16
+ button_x = Pin (14 , Pin .IN , Pin . PULL_UP )
17
+ button_y = Pin (15 , Pin .IN , Pin . PULL_UP )
15
18
16
19
display = PicoGraphics (display = DISPLAY_PICO_DISPLAY_2 , pen_type = PEN_RGB565 , rotate = 0 )
17
20
display .set_backlight (0.8 )
You can’t perform that action at this time.
0 commit comments