Robotics Python
Intermediate
60 mins
155 points
What you need:
Computer/laptop
USB Cable
Raspberry Pi PICO W
iPad/iPhone USB adapter

Pico's First Blink

In this lesson, you'll create a simple program to make the onboard LED on your Raspberry Pi Pico blink using CircuitPython language.
Learning Goals Learning Outcomes Teacher Notes

1 - Introduction

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 your computer using a micro USB cable.
  • to your iPad using a micro USB cable and a iPhone/iPad to USB adapter.

2 - Choose Your 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.

3 - Connect the Editor to Your Pico

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.


4 - Create a New File

Create a new file in your chosen editor and with the name 'code.py'.

5 - Import Libraries

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.

Unlock the Full Learning Experience

Get ready to embark on an incredible learning journey! Get access to this lesson and hundreds more in our courses.

Copyright Notice
This lesson is copyright of Coding Ireland. Unauthorised use, copying or distribution is not allowed.
🍪 Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies. Learn more