Stairlights: update to the code

Stairlights: update to the code

Three years ago, THREE years ago! I made these awesome stairlights and wrote a tutorial that ended up in the MagPi magazine

https://www.raspberrypi.org/magpi-issues/MagPi58.pdf

I'm always removing the stairlights - the raspberry pi or the power supply - for other projects. Today I wanted to put them back on so I found a raspberry pi zero w, loaded the old code into and added a power supply.

And of course, since the code is over 3 years old, it didn't work.

First, I forgot to add the neopixel library to this new pi. The link in the MagPi article is not working. Here's the new one:
https://learn.adafruit.com/adafruit-neopixel-uberguide/python-circuitpython

You actually only need this line:

sudo pip3 install adafruit-circuitpython-neopixel

Then the code also needs changing. I've uploaded my own version to github here:
https://github.com/Lorrainbow/stairlights/blob/master/stairlights.py

The physical setup is the same. The pi is connected to the lights through GPIO pin 18 and a ground pin.

Shiny!
20200310_111629-1

Related Article