← How-Tos
raspberry-pi Mar 26, 2026 ◯ 1 min read

Raspberry Pi Pico — First Steps with MicroPython

raspberry pipicomicropythonmicrocontroller

The Pico is a microcontroller (not a Linux computer). It runs MicroPython and is ideal for always-on sensor and automation projects.

Models

Install MicroPython

  1. Download .uf2 from micropython.org/download/rp2-pico
  2. Hold BOOTSEL button on Pico
  3. Connect via USB — Pico appears as USB drive
  4. Drag .uf2 onto drive
  5. Pico reboots into MicroPython

Thonny IDE

Download from thonny.org. Bottom-right: select MicroPython (Raspberry Pi Pico).

Blink the Built-in LED

from machine import Pin
import time

led = Pin("LED", Pin.OUT)

while True:
    led.toggle()
    time.sleep(0.5)

Read a Button

from machine import Pin
import time

button = Pin(14, Pin.IN, Pin.PULL_DOWN)
led    = Pin(15, Pin.OUT)

while True:
    led.value(button.value())
    time.sleep(0.01)

Pico W — Connect to Wi-Fi

import network, time

wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect("YourSSID", "YourPassword")

while not wlan.isconnected():
    time.sleep(0.5)

print(f"Connected: {wlan.ifconfig()}")

Pico vs Full Raspberry Pi