In this lesson, we will create a simple project to make the onboard LED on your Raspberry Pi Pico blink. To begin, connect your Raspberry Pi Pico :
To connect your Raspberry Pi Pico W to your computer, follow these steps:
Note: If you want to connect your Pico in USB mass storage device mode (so you can copy files to it), hold down the BOOTSEL button as you are connecting the USB to your computer.
To connect your Raspberry Pi Pico W to your iPad, follow these steps:
Depending on the device you are using, you will need to use a different editor:
Depending on the device you are using, you will need to use a different editor:
If you are using a PC or laptop, open your web browser and go to code.circuitpython.org
If you are using an iPad, download and install the Koder app from the App Store.
If you are using the CircuitPython editor (code.circuitpython.org) then we need to connect the editor to your PICO W so that we can transfer code to it.
You can skip this step if you're using an iPad.
To connect your editor (at code.circuitpython.org) to your PICO W follow these steps:
Your editor should now be connected to your PICO W and ready to code.
Create a new file in your chosen editor and with the name 'code.py'.
In your CircuitPython editor (code.circuitpython.org):
Note: the CircuitPython editor starts with a new file open and ready to go, so you might not need to do this.
On your Koder app:
In this step, you will import the necessary libraries for your project. A library is a collection of pre-written code that you can use to perform specific tasks. By importing libraries, you can save time and effort, as you don't have to write the code from scratch.
Type the following lines of code to import the necessary libraries:
import board
import digitalio
import time
Here's what each library does:
board
: This library provides definitions for pins and sets up the hardware on the board.digitalio
: This library allows for digital input and output, such as reading a switch or controlling an LED.time
: This library provides functions for delays and tracking time.