Tutorial
π‘ Tip: Disable headers/footers in your print dialog for a clean PDF.
Β
Thonny + MicroPython β Pico/Pico W π
π§ Why Thonny?
Thonny is a simple Python editor that just works. Plug in a Pico, click run, smile.
Goal: install Thonny β flash MicroPython β run βblinkβ. Tiny code, big vibe.
π» Install Thonny
- Download Thonny for your OS and install it.
- Open Thonny. If it asks about Python, choose the default.
β οΈ School computers might need IT to installβask early.
π Flash MicroPython onto the Pico
- Unplug the Pico. Hold the BOOTSEL button.
- While holding, plug it in via USB β a drive called
RPI-RP2appears. - In Thonny: Tools β Options β Interpreter:
- Interpreter: MicroPython (Raspberry Pi Pico)
- Port: the one that appears when Pico is plugged
- Click: Install or update MicroPython β follow prompts
π‘ Pico W? Pick the Pico W firmware in the installer.
β¨ First Script: Blink
Type this in Thonny:
from machine import Pin, Timer
led = Pin("LED", Pin.OUT)
timer = Timer()
def tick(t): led.toggle()
timer.init(freq=2, mode=Timer.PERIODIC, callback=tick)
- Click Run. Save to MicroPython device as
main.pyto auto-start. - LED should blink. If not, try
Pin(25, Pin.OUT)on some Pico boards.
π§― Quick Fixes
- No device? Try another USB cable (must be data) and port.
- Canβt flash? Re-enter BOOTSEL mode and retry installer.
- Wrong port? Thonny β bottom-right status bar β change Interpreter/Port.
π Next Moves
- Read a button, beep a buzzer, fade an LED (PWM).
- Pico W: connect Wi-Fi and print your IP.
Python + hardware = instant power. π₯