led_on_and_off
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| led_on_and_off [2026/06/12 22:41] – [Introduction] walkeradmin | led_on_and_off [2026/06/17 16:39] (current) – walkeradmin | ||
|---|---|---|---|
| Line 10: | Line 10: | ||
| \\ | \\ | ||
| \\ | \\ | ||
| - | {{ : | + | {{ : |
| \\ | \\ | ||
| In the above picture we can see where the LED is. Once powered on the LED by default will be off, and we will need to use some micro python to turn it on. | In the above picture we can see where the LED is. Once powered on the LED by default will be off, and we will need to use some micro python to turn it on. | ||
| Line 18: | Line 18: | ||
| \\ | \\ | ||
| \\ | \\ | ||
| - | {{ : | + | {{ : |
| \\ | \\ | ||
| Here we can see the code that we need to enter in to Thonny. | Here we can see the code that we need to enter in to Thonny. | ||
| \\ | \\ | ||
| \\ | \\ | ||
| - | <code | download> | + | <code: |
| # Import the picozero LED class | # Import the picozero LED class | ||
| from picozero import pico_led | from picozero import pico_led | ||
| Line 31: | Line 31: | ||
| </ | </ | ||
| \\ | \\ | ||
| - | This of course turns the Pi Pico LED on. | + | To run this code, click the green play button on the Thonny toolbar. |
| \\ | \\ | ||
| \\ | \\ | ||
| Line 64: | Line 64: | ||
| Now that you have turned the LED on, you might want to turn it off, and the program is almost the same except for the argument for the pico_led line. | Now that you have turned the LED on, you might want to turn it off, and the program is almost the same except for the argument for the pico_led line. | ||
| \\ | \\ | ||
| - | <code | download> | + | <code: |
| # Import the picozero LED class | # Import the picozero LED class | ||
| from picozero import pico_led | from picozero import pico_led | ||
| Line 79: | Line 79: | ||
| {{ : | {{ : | ||
| \\ | \\ | ||
| + | That is it, we can now successfully turn on and off the onboard LED on the Pi Pico, as well as creating our first piece of Micro Python in Thonny. | ||
| + | \\ | ||
| + | \\ | ||
| + | ---- | ||
led_on_and_off.1781304066.txt.gz · Last modified: by walkeradmin
