gpio_inputs_-_led_control_via_a_button_and_interrupt
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
gpio_inputs_-_led_control_via_a_button_and_interrupt [2017/02/01 22:07] – [Example Output] walkeradmin | gpio_inputs_-_led_control_via_a_button_and_interrupt [2023/03/09 22:35] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 7: | Line 7: | ||
Create a new file in the normal way ( you can download the python file {{ : | Create a new file in the normal way ( you can download the python file {{ : | ||
\\ | \\ | ||
+ | <sxh [py][; options for SyntaxHighlighter]> | ||
sudo nano LED-Button-i.py | sudo nano LED-Button-i.py | ||
Line 47: | Line 48: | ||
| | ||
#End | #End | ||
+ | </ | ||
\\ | \\ | ||
Once you have your file saved, you can run it by using: | Once you have your file saved, you can run it by using: | ||
Line 54: | Line 56: | ||
===== Example Output ===== | ===== Example Output ===== | ||
\\ | \\ | ||
- | Here you can see the code running {{ : | + | Here you can see the code running. |
+ | \\ | ||
+ | \\ | ||
+ | {{: | ||
+ | \\ | ||
\\ | \\ | ||
The main advantage using the **interrupt** is that my processor occupancy on the Pi Zero is now around 10% normal, and 14% when I press the button. That's much better than the previous constant 100%. | The main advantage using the **interrupt** is that my processor occupancy on the Pi Zero is now around 10% normal, and 14% when I press the button. That's much better than the previous constant 100%. |
gpio_inputs_-_led_control_via_a_button_and_interrupt.1485986844.txt.gz · Last modified: 2023/03/09 22:35 (external edit)