rpi-rgb-led-matrix/python/README.md

43 lines
866 B
Markdown
Raw Normal View History

2015-06-28 09:38:55 +00:00
Python bindings for RGB Matrix library
======================================
Building
--------
2016-07-30 11:59:55 +00:00
In the root directory for the matrix library simply type:
2015-06-28 09:38:55 +00:00
2016-07-30 11:59:55 +00:00
```shell
sudo apt-get update && sudo apt-get install python2.7-dev -y
make build-python
sudo make install-python
```
You can also build for Python 3:
```shell
2016-08-20 17:43:54 +00:00
sudo apt-get update && sudo apt-get install python3.4-dev -y # or 3.5
2016-07-30 11:59:55 +00:00
export PYTHON=$(which python3.4)
make build-python
sudo make install-python
```
2015-06-28 09:38:55 +00:00
Using the library
-----------------
2016-07-30 11:59:55 +00:00
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.
```python
#!/usr/bin/env python
from rgbmatrix import RGBMatrix
import time
2015-06-28 09:38:55 +00:00
rows = 16
chains = 1
parallel = 2
myMatrix = RGBMatrix(rows, chains, parallel)
myMatrix.Fill(255, 0, 0)
time.sleep(5)
myMatrix.Clear()
```