Getting started · Lesson 1 of 5· 12 min
Your free robotics lab
Why this matters
Real robot kits cost money and take weeks to arrive. A simulator lets you wire parts and run real code today, for free. When you get a real board later, the same code works on it.
Meet Wokwi and the Raspberry Pi Pico
Wokwi (wokwi.com) is a free electronics simulator that runs in your browser. We use it with a Raspberry Pi Pico, a small, cheap board that runs MicroPython, a version of Python made for microcontrollers. If you have done any Python on RiseAfrica, you will feel at home.
Open a tool
Wokwi simulator
Free, nothing to install. Works best on a laptop; on a phone you can still read the steps and the code below.
Opens wokwi.com in a new tab. Come back here when you are done.
Step by step
-
Press Open Wokwi simulator above. A laptop works best.
-
You will see the Pico on the right and a file called main.py on the left.
-
Press the green play button. The simulation starts. Press stop to end it.
Your first program: blink
Delete what is in main.py, then type this and press play:
from machine import Pin
import time
led = Pin(25, Pin.OUT) # the small LED built into the Pico
while True:
led.toggle() # on if it was off, off if it was on
time.sleep(0.5) # wait half a second
The little green light on the board blinks. That is the sense, think, act loop from Robotics Introduction with only the act part: the loop runs forever, and each time round it changes the light.
Your task
Change 0.5 to 0.1, then to 2. Run it each time. What does the number control? Write one sentence about it in your notes.