Pico: run multiple tasks with asyncio
Blink an LED, read a sensor, and serve a web page at the same time on a Pico with MicroPython asyncio. Cooperative multitasking without an RTOS.
Platform
Cheap, fast, surprisingly fun once you wrap your head around PIO. MicroPython or C.
27 tutorials
Blink an LED, read a sensor, and serve a web page at the same time on a Pico with MicroPython asyncio. Cooperative multitasking without an RTOS.
Wire a microSD card to a Pico over SPI and write timestamped CSV sensor logs that survive power loss. The offline data logger pattern.
Wire a Pico to an L298N motor driver, drive one or two DC motors with PWM speed control in MicroPython, and get direction control for free. The start of every wheeled robot.
Send email straight from a Pico W over SMTP with STARTTLS in MicroPython. Works with your own mail server or any provider's app password, no cloud IoT service in the middle.
Wire a cup anemometer's reed switch to a Pico, count pulses with an interrupt, and convert pulse rate to wind speed with the manufacturer's constant.
Wire a NEO-6M GPS module to a Pico over UART, parse NMEA sentences in MicroPython for position and atomic-clock UTC time, and learn why the first fix takes minutes outdoors.
Read the temperature sensor inside the RP2040 chip with MicroPython's ADC and the 27-degree conversion formula. Zero wiring, one ADC channel, and a warning about what the number actually means.
Install the arduino-pico core, upload a blink sketch, and learn when the Pico deserves C++ instead of MicroPython: interrupts, timing precision, and memory headroom.
Wire a 28BYJ-48 stepper to a Raspberry Pi Pico with the ULN2003 board and drive it with MicroPython. Precise position control for about $3 in parts.
Give a Pico W a fixed IP address with MicroPython so bookmarks, port forwards, and automations keep working after the router reboots.
Scan the I2C bus on a Pico for connected devices, recover from a locked-up SDA line, and understand the 7-bit vs 8-bit address gotcha. The pattern that turns 'my sensor is not responding' into a 30-second fix.
Use the Pico's 8 PWM slices from MicroPython to drive servos, dim LEDs, generate tones, and synthesize analog output with a low-pass filter.
Wire two devices with TX, RX, and a common ground. Read a GPS module, talk to a Nextion display, or exchange data between two Picos over UART in MicroPython.
Serve a real async web API from a Pico W using uasyncio, with background sensor tasks and non-blocking request handlers. The right way after the synchronous server gets too small.
Turn a Pico W into a BLE peripheral that a phone can connect to over Bluetooth Low Energy, with a GATT service, read, write, and notify characteristics.
Flash MicroPython to a Raspberry Pi Pico 2 (RP2350), connect over the REPL, and see what's new vs the original Pico. The 20-minute Pico 2 setup.
Drive a 640x480p60 DVI display from a Raspberry Pi Pico 2 using the new HSTX peripheral. The Pico 2 can output digital video; the original Pico could not.
What changed in the PIO state machines between the Pico RP2040 and the Pico 2 RP2350. Most existing PIO programs run unchanged; the new bits matter for HSTX and ADC.
Use TrustZone on the Raspberry Pi Pico 2 RP2350 to isolate secure boot, sign firmware, and lock down GPIO. C SDK only; MicroPython does not expose TrustZone.
Connect a Pico W to Wi-Fi and publish sensor readings to an MQTT broker from MicroPython. The pico equivalent of the ESP32 MQTT tutorial.
Read a DHT22 or BME280 and serve a live dashboard from a Pico W. The smallest, cheapest way to put a sensor reading on your phone's browser.
The Pico's Programmable I/O can drive WS2812B LEDs without blocking your code. A reusable PIO program you can drop into any project.
The shortest possible Pico + MicroPython tutorial. Blink the LED. Get to a working project before you know all the theory.
Control a hobby servo from a Pico using PWM and MicroPython. Includes the library code I use in every Pico servo project.
Wire a DHT22 temperature and humidity sensor to a Pico and read it from MicroPython. The smallest useful Pico sensor project.
Connect the Pico W to Wi-Fi and serve an HTML page from the chip. The smallest useful web server on a $6 microcontroller.
Flash MicroPython to a Raspberry Pi Pico, connect over the REPL, and run your first script. The 10-minute Pico setup.