PyRasp

← All practice problems

Raspberry Pi Pico practice problem · Raspberry Pi Pico

Relay lamp

MediumBudget $19MicroPython

A relay module lets a 3.3 V pin switch a 5 V load. Its coil is powered from VBUS, its input IN is on GP13, and the lamp hangs between COM and NO on the same 5 V rail.

Each debounced press of the button on GP12 toggles the lamp. Start with it off.

More in Raspberry Pi Pico