Raspberry Pi Pico Python SDK
NOTE
Serial also includes
The Serial-over-USB port will show up as
in FS mode — CDC" in the port selector window when you open the application. Connect to this port and hit Return and
you should see the REPL prompt.
2.4. Say "Hello World"
Once connected you can check that everything is working by typing a Python "Hello World" into the REPL,
>>> print("Hello, Pico!")
Hello, Pico!
>>>
2.5. Blink an LED
The on-board LED on Raspberry Pi Pico is connected to GPIO pin 25. You can blink this on and off from the REPL. When
you see the REPL prompt enter the following,
>>> from machine import Pin
>>> led = Pin(25, Pin.OUT)
The
machine
module is used to control on-chip hardware. This is standard on all MicroPython ports, and you can read more
about it in
the MicroPython
If you type this in,
>>> led.value(1)
The LED should turn on. You can turn it off again with
>>> led.value(0)
2.6. What next?
At this point you should have MicroPython installed on your board, and have tested your setup by typing short programs
into the prompt to print some text back to you, and blink an LED.
You can read on to the next chapter, which goes into the specifics of MicroPython on RP2040, and where it differs from
other platforms.
You can learn how to set up an integrated development environment (IDE) in
programs in line by line.
You can dive straight into
2.4. Say "Hello World"
driver support
if needed.
/dev/tty.usbmodem0000000000001
documentation. Here we are using it to take control of a GPIO, so we can drive it high and low.
Chapter 3
also has some short examples of the different APIs offered to interact with the hardware.
Appendix A
if you are eager to start connecting wires to a breadboard.
. If you're using Serial this will be shown as "Board
Chapter
4, so you don't have to type
11
Need help?
Do you have a question about the Pico Python SDK and is the answer not in the manual?