When you plug in a Gemma M0 running CircuitPython, the DotStar RGB LED on the board pulses green if there's no
code.py program to run. If there is a
code.py, it shows solid green.
Pulsing green was a little spooky for this nightlight, so I wrote a
code.py to run forever:
That's it, that's the whole nightlight program -- the shortest project code you'll ever see! To use, just copy and save it as
code.py on your
Then I plugged it in to an AC adapter with a short USB cable, but if you only have a long one, you could bunch it up with a twist tie.
This simple nightlight was good enough for our houseguests, but let's make a nicer one. Onward!