using_the_pico_run_button_-_simple
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| using_the_pico_run_button_-_simple [2026/07/16 15:55] – [Introduction] walkeradmin | using_the_pico_run_button_-_simple [2026/07/16 16:29] (current) – walkeradmin | ||
|---|---|---|---|
| Line 7: | Line 7: | ||
| ===== Introduction ===== | ===== Introduction ===== | ||
| \\ | \\ | ||
| - | The Raspberry Pi Pico has a RUN pin, see below. | + | We can reset the Pico at anytime if we have a way to ground the Pico RUN Pin, Pin30 to GND. This will at a hardware level instantly restart the Pico, no user created code is required for this, it is all hardware level. This provides us with a very simple way of restarting some code, if we need to. |
| + | \\ | ||
| + | \\ | ||
| + | The Raspberry Pi Pico has a RUN pin on Pin30, see below. | ||
| \\ | \\ | ||
| \\ | \\ | ||
| Line 15: | Line 18: | ||
| \\ | \\ | ||
| \\ | \\ | ||
| - | Connect the other button | + | Connect the button as shown below, we are using the Raspberry Pico onboard LED. |
| \\ | \\ | ||
| \\ | \\ | ||
| {{ : | {{ : | ||
| \\ | \\ | ||
| - | The code I am going to use is our traffic light code, with the breakout button. And I am using this code for a very specific reason. | + | The code we are going to use is a simple piece of Micro Python to flash the onboard LED, this code works on both the Wireless and non Wireless Pico boards. |
| + | \\ | ||
| + | \\ | ||
| + | === Pico Code === | ||
| + | |||
| + | Download | ||
| + | |||
| + | < | ||
| + | from picozero import pico_led | ||
| + | pico_led.blink(0.1) | ||
| + | </ | ||
| + | |||
| + | If you reboot the Pico (unplug it and plug it back in) the main.py file will be loaded on boot, and the onboard LED will start to flash. | ||
| + | \\ | ||
| \\ | \\ | ||
| - | * 1. The code runs as main.py so when the Pico starts (boots) the code runs. | + | {{ :run-button-simple.mp4? |
| - | * 2. There is a button | + | |
| - | * 3. Once the breakout button has been used, the cable has to be removed and plugged back in, this causes unnecessary wear. | + | |
| - | * By using the RUN pin, I can start/ | + | |
| - | * The RUN button operates at a hardware level, it requires no user generated code. | + | |
| \\ | \\ | ||
| - | Download | + | Looking at the video above, we can see the code that flashes the LED is running, we press the button that connects the RUN button |
| \\ | \\ | ||
| \\ | \\ | ||
| + | ---- | ||
| + | |||
| + | |||
using_the_pico_run_button_-_simple.1784217338.txt.gz · Last modified: by walkeradmin
