We previously blinked the Raspberry Pi Pico's internal LED with the following Python code.
00:00
To use an external LED, we need to change this GPIO pin (which is currently 25) number.
00:00
We're going to change the code to now use GPIO pin 1.
00:00
An LED (Light Emmiting Diode) has a + anode (long leg) and a - cathode (short leg).
00:00
Insert your Raspberry Pi Pico into a breadboard.
00:00
Insert an LED such that the long leg is connected to GPIO 1 and the short leg is connected to Ground.
00:00
When done your Raspberry Pi Pico Blink Circuit should look like this.
00:00
As we've done in the past, to copy the main.py python file across to our Pico Board we use the command: ampy -p /dev/tty.usbmodem0000000000001 put ~/Desktop/main.py
00:00
You'll know things are working when the LED is blinking.
00:00
main.py
xxx
Terminal
screen /dev/tty.usbmodem0000000000001 115200
>>> led = Pin(25, Pin.OUT)
>>> from machine import Pin
Breadboard
Breadboard
Mark
© 2022 Chick Commerce Pty Ltd