This project contains scripts that perform lighting effect sequences for Adafruit Dotstar LED strips.
- Raspberry Pi 3
- Adafruit Dotstar LED Strip
- Breadboard
- Jumper Wires
- 5V Power Supply (2-4 Amps recommended)
- Python 3.5+
- Adafruit CircuitPython
The Dotstar has four connections:
- Ground - Connect this to the common ground for the power supply and Raspberry Pi (i.e. ground rail of a breadboard)
- Power - Connect this to a +5V power supply. Make sure your supply has enough current for your LED strip.
- Clock Input (CI) - Connect this to Raspberry Pi's SPI SCLK Pin
- Data Input (DI) - Connect this to Raspberry Pi's SPI MOSI Pin
See Adafruit's Power and Connections guide for more information.
Copy and set the .env Environment file for your configuration
cp .env.example .env
The Python scripts will likely need packages installed using a Python package manager like PIP.
pip install -r requirements.txt
Run the sequence on an LED strip.
python play.py cuttlefish
Run a browser-based 2D simulation of the Sequence with WebGL shader
Run a browser-based 3D simulation of the Sequence using Three.js
Contains static data to be read in for rendering a sequence
Contains project documentation resources
Python modules for static lighting patterns
Contain images created by render-sequence.py
Python modules for animated lighting sequences
A web server for controller lighting sequences remotely
python ./server/index.py
Contains show definitions in JSON format. Used by schedule.py.
Run a demonstration show on the LED strip. This will go through several sequences as defined in a JSON file.
Run a single sequence on an LED strip.
Render a Sequence to a static PNG image where each line represents a frame of the Sequence, and each column represents a single LED in the strand.
Run this script continuously with different sequences scheduled for each day. This should generally be run as a background process.
Simulate and save a Sequence as an animated GIF (as displayed in this readme file).
This code runs a local webserver that will read a Sequence represented as a PNG image and render it as a WebGL shader.
From the 2d-simulator
directory:
npm install
npm run dev
This code includes a browser-based simulator to display the lighting sequences. It uses Node and Three.js. This reads sequences as PNG images, where each column of the image represents a single LED in the strand, and each row represents a frame of the animated sequence.
From the 3d-simulator
directory:
npm install
npm run dev
Running npm run dev
will start a server using Vite and provide a locally hosted URL to load in your browser to view the simulation.
This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) License.
This project makes use of the Adafruit CircuitPython DotStar library, Three.js and other third party code. When using this project, please adhere to their respective licenses as necessary.