more python
This commit is contained in:
parent
6c083e13df
commit
629483e8bf
@ -127,20 +127,20 @@ def handle_button(pin):
|
|||||||
|
|
||||||
# Loop through out buttons and attach the "handle_button" function to each
|
# Loop through out buttons and attach the "handle_button" function to each
|
||||||
# We're watching the "FALLING" edge (transition from 3.3V to Ground) and
|
# We're watching the "FALLING" edge (transition from 3.3V to Ground) and
|
||||||
# picking a generous bouncetime of 100ms to smooth out button presses.
|
# picking a generous bouncetime of 150ms to smooth out button presses.
|
||||||
for pin in BUTTONS:
|
for pin in BUTTONS:
|
||||||
GPIO.add_event_detect(pin, GPIO.FALLING, handle_button, bouncetime=100)
|
GPIO.add_event_detect(pin, GPIO.FALLING, handle_button, bouncetime=150)
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
if display.show_menu is True:
|
if display.show_menu is True:
|
||||||
# test menu
|
# test menu
|
||||||
display.updateMenu(
|
display.updateMenu(
|
||||||
[
|
[
|
||||||
{"output": "▲"},
|
{"output": "▲", "selected": False},
|
||||||
{"output": "Toggle repeat", "selected": True},
|
{"output": "Toggle repeat", "selected": True},
|
||||||
{"output": "Toggle shuffle"},
|
{"output": "Toggle shuffle", "selected": False},
|
||||||
{"output": "View queue"},
|
{"output": "View queue", "selected": False},
|
||||||
{"output": "▼"}
|
{"output": "▼", "selected": False}
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
# test album art
|
# test album art
|
||||||
|
Loading…
Reference in New Issue
Block a user