Sign inSign up

fragaria/rpi-led-control

By fragaria

•Updated almost 7 years ago

APA102 LED on Raspberry PI control via Python REST API

Image
0

650

fragaria/rpi-led-control repository overview

⁠rpi-led-control

Dockerized REST API for LED control on Raspberry Pi. Available on GitHub⁠.

To make this work, attach a strip of two (or more) APA102 LEDs to Raspberry Pi GPIO pins:

  • GND - GND
  • VCC - 5V
  • DI (data) - rpi pin 14
  • CI (clock) - rpi pin 15

And then run

docker pull fragaria/rpi-led-control && docker run -d --device /dev/gpiomem:/dev/gpiomem -p 5000:5000 -e NUM_LED=2 -e START_COLOR=16711680 fragaria/rpi-led-control

By sending the decimal color values via POST, you can control what colors the LEDs are. For color conversion, you can use this tool⁠.

The LED positions are addressed from the start of the cable. Values are decimal color representation (0-16777215).

curl -X POST -d '{"leds":[20000, 255]}' -H "Content-Type: application/json" http://10.192.202.91:5000

Tag summary

Content type

Image

Digest

Size

50.7 MB

Last updated

almost 7 years ago

docker pull fragaria/rpi-led-control