using_a_breakout_button
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| using_a_breakout_button [2026/07/15 19:37] – [The Code] walkeradmin | using_a_breakout_button [2026/07/15 20:02] (current) – walkeradmin | ||
|---|---|---|---|
| Line 84: | Line 84: | ||
| if button.value() == 0: # Button pressed (LOW) | if button.value() == 0: # Button pressed (LOW) | ||
| print(" | print(" | ||
| + | all_off() | ||
| break # Exit the loop and end main.py | break # Exit the loop and end main.py | ||
| ####################### | ####################### | ||
| Line 116: | Line 117: | ||
| \\ | \\ | ||
| \\ | \\ | ||
| + | However, if you read the code, you can see the button value is read as the <color # | ||
| + | \\ | ||
| + | \\ | ||
| + | === Example === | ||
| + | \\ | ||
| + | <color # | ||
| + | \\ | ||
| + | \\ | ||
| + | This will enable to code to run on the Pico boot up. | ||
| + | \\ | ||
| + | \\ | ||
| + | Here is the button in action. | ||
| + | \\ | ||
| + | \\ | ||
| + | {{ : | ||
| + | \\ | ||
| + | Using a button like this means you can never get you Pico stuck in a software loop with little to no way of recovery (without wiping it completely). | ||
| + | \\ | ||
| + | \\ | ||
| + | ---- | ||
using_a_breakout_button.1784144268.txt.gz · Last modified: by walkeradmin
