rpi-rgb-led-matrix/python
2016-08-28 17:45:53 -07:00
..
rgbmatrix o Warning when image is not in RGB mode. 2016-08-28 17:45:53 -07:00
samples o Move validation into c-code. 2016-08-28 13:39:32 -07:00
.gitignore o Added support for background colors on DrawText and DrawGlyph 2015-12-01 22:30:55 -08:00
Makefile o Some initial Makefile cleanup. 2016-08-28 12:37:10 -07:00
README.md o Warning when image is not in RGB mode. 2016-08-28 17:45:53 -07:00
setup.py o Improved directory structure of Python code. 2015-07-23 23:44:27 -07:00

Python bindings for RGB Matrix library

Building

In the root directory for the matrix library simply type:

sudo apt-get update && sudo apt-get install python2.7-dev python-pillow -y
make build-python
sudo make install-python

You can also build for Python 3:

sudo apt-get update && sudo apt-get install python3-dev python3-pillow -y
export PYTHON=$(which python3)
make build-python
sudo make install-python

Using the library

Be aware of the fact, that using the RGBMatrix requires root privileges. Therefore you will need to run all you python scripts as using sudo.

You find examples in the samples/ subdirectory.

#!/usr/bin/env python
from rgbmatrix import RGBMatrix
import time

rows = 16
chains = 1
parallel = 2
myMatrix = RGBMatrix(rows, chains, parallel)
myMatrix.Fill(255, 0, 0)
time.sleep(5)
myMatrix.Clear()