hzeller / rpi-rgb-led-matrix

Controlling up to three chains of 64x64, 32x32, 16x32 or similar RGB LED displays using Raspberry Pi GPIO
GNU General Public License v2.0
3.67k stars 1.17k forks source link

Python graphics module does not function #97

Closed lanrat closed 8 years ago

lanrat commented 8 years ago

When testing the python bindings everything defined in core.pyx works great, but when using any of the functions from graphics.pyx nothing is displayed.

Below is a sample program that I think should draw a vertical red line, however it does not print anything on the display. Manually calling SetPixel works fine.

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

rows = 16
chains = 2
parallel = 1
matrix = RGBMatrix(rows, chains, parallel)

red =  graphics.Color(255, 0, 0)
graphics.DrawLine(matrix, 10, 10, 0, 10, red)

time.sleep(10)
hzeller commented 8 years ago

@Saij can you have a look ?

hzeller commented 8 years ago

graphics.Color is a class that has red, green and blue properties, but no constructor with these values. It should probably have one. Will add it.

hzeller commented 8 years ago

Fixed in https://github.com/hzeller/rpi-rgb-led-matrix/commit/cd0a5e3fbfe25163907910f1a58a304d390e275a

@Saij can you have a look if I did not screw up Python ? Generated code with cython 0.23.4

Saij commented 8 years ago

Looks fine. Thanks for fixing it/adding the constructor