Inspiration
I want to be able to connect services to RGB LEDs as a form of outputting information, so I came up with this project as a way to enable that for future projects. This combines CS with a little bit of Electrical Engineering.
What it does
Would receive GET and POST requests on an /led/ endpoint with the id referring to an LED's place in the chain. GET would return a JSON message containing the hex value of its current color. POST would set the associated LED's color to the value specified in an attached JSON message. The program would store the color value of each NeoPixel, as the library itself doesn't guarantee that the value read is what was written (due to the communication being one-way to the pixels).
How we built it
It was planned to be built using Flask and Adafruit's NeoPixel library for CircuitPython. The LEDs are NeoPixels by Adafruit which use a WS2812 chip to allow a single-line control signal to provide the color for the RGB LED.
Challenges we ran into
My Pi couldn't seem to correctly download Adafruit's NeoPixel library for the LEDs.
Accomplishments that we're proud of
Finding the right value of capacitor needed in my many bags of components.
What we learned
CircuitPython on Pi is harder to install than I thought.
What's next for RestGB
Adding websocket connections to allow notifying listeners of when an LED's color changes. Accepting and returning multiple color formats.
Built With
- flask
- neopixel
- python
- raspberry-pi
- rest
Log in or sign up for Devpost to join the conversation.