MicroPython LED Blink Example for Raspberry Pi Pico 2 W

A small MicroPython example for learning GPIO output and timing on a Raspberry Pi Pico 2 W. The program toggles the onboard LED once per second using machine.Pin and time.sleep.

What is included?

Run requirements

Use a board running the matching MicroPython firmware. The machine module is supplied by MicroPython; this example is intended to run on the board rather than ordinary desktop Python.

Follow the official RP2 getting-started guide for firmware setup, then transfer the example to the board with a compatible MicroPython tool.

The code is an introductory LED example. It does not connect to Wi-Fi or require an external service. Hardware execution was not verified in this documentation update.


Read all MicroPython & Pico Examples guides online · Project overview · All developer projects