njbbaer / unicorn-remote

Control your Unicorn HAT LED matrix from the web
MIT License
38 stars 6 forks source link
api led-matrix-displays pi pimoroni python raspberry-pi raspberrypi unicorn unicorn-hat unicorn-hat-hd unicornhat

Unicorn Remote Logo

Code Climate

Unicorn Remote is a web based remote control for the Unicorn HAT LED matrix. It allows you to control light grid programs from a desktop or mobile browser and a web API.

Supports both the new Unicorn HAT HD 16x16 and original Unicorn HAT 8x8. It comes with a built-in set of programs for both, and allows you add your own.

The Unicorn HAT and HAT HD are available from Pimoroni.

If this software has been useful to you, please star the repository to show your interest.

Web UI screenshot Demo animation

Setup

  1. Follow first time setup for Unicorn HAT or Unicorn HAT HD

  2. Clone or download the repository:

git clone https://github.com/njbbaer/unicorn-remote.git
cd unicorn-remote
  1. Create a virtual environment (recommended)
virtualenv venv
  1. Either enter the virtual environment with source venv/bin/activate or prefix commands with venv/bin/.

  2. Install dependencies

pip install -r requirements.txt
  1. Start Unicorn Remote
python run.py

Optional Arguments

-o --original use original 8x8 unicorn hat
-d --debug enable Flask debugging mode
-p --port <port> set port number (default 5000)

Web Interface

Visit the web interface by directing a browser to the server's address.

http://localhost:5000

Custom Programs

To add your own custom program, simply copy it into one of the follow directories:

app/programs/hd for 32x32 programs
OR app/programs/original for original 16x16 programs

No additional configuration required!

REST API

Start a program by placing a PUT request:

PUT /api/program/<program_name>

Stop the currently running program:

PUT /api/stop

Testing

Run the test suite. Enjoy the light show.

python -m unittest

Contribute