A simple program to light a liquor cabinet using a Raspberry Pi Pico a reed switch, and LEDs using Micropython. The code uses the Pico PIO. It probably doesn't need to, but, you know, why not? The light(s) willl go off if the door is closed, but is also on a timer so the light(s) will go out after 60 seconds if the door is left open.
- Install Micropython
- Once Micropython is installed copy the contents of the
main.pytomain.pyon the Pico. - Wire the reed switch GPIO pin 2.
- Wire a 10k ohm pull up resistor from the 3.3V pin to pin 16
- Wire any LEDs to GPIO pin 6
That's it. Plug it in and call it good.
- Tom Camp - initial work - Tom-Camp
This project is licensed under the MIT License - see the LICENSE file for details