-
Notifications
You must be signed in to change notification settings - Fork 142
Open
Description
examples/7color/buttons.py
crashes with a stacktrace when the program is interrupted with Ctrl+C. I expected a clean exit, so exception KeyboardInterrupt should be caught.
$ ./buttons.py
buttons.py - Detect which button has been pressed
This example should demonstrate how to:
1. set up gpiod to read buttons,
2. determine which button has been pressed
Press Ctrl+C to exit!
Button press detected on GPIO #5 label: A
Button press detected on GPIO #6 label: B
Button press detected on GPIO #16 label: C
Button press detected on GPIO #24 label: D
Button press detected on GPIO #24 label: D
^CTraceback (most recent call last):
File "/home/dolmen/Pimoroni/inky/examples/7color/./buttons.py", line 62, in <module>
for event in request.read_edge_events():
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/dolmen/.virtualenvs/pimoroni/lib/python3.11/site-packages/gpiod/line_request.py", line 223, in read_edge_events
return cast(_ext.Request, self._req).read_edge_events(max_events)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyboardInterrupt
Metadata
Metadata
Assignees
Labels
No labels