getting display() to work properly
See original GitHub issueType of Raspberry Pi
Raspberry Pi 3 B Plus
Linux Kernel version
Linux raspberrypi 4.14.52-v7+ #1123 SMP Wed Jun 27 17:35:49 BST 2018 armv7l GNU/Linux
Expected behaviour
I am trying to use display() to work, showing a (rather crude) drawing of a pair of eye on two daisy chained 8x8 matrices. The setup works fine with all examples provided, and I can tweak them to chance text, speeds and other characteristics of the displayed content.
Still, I can’t get display() to work, that is, I can’t display drawings of my own concoction.
Here is the code that got me the farthest: it doesn’t generate errors and <<something>> (I can’t be sure what) flashes briefly on the displays. The code:
import numpy as np
from PIL import Image
from luma.core.interface.serial import spi, noop
from luma.led_matrix.device import max7219
serial = spi(port=0, device=0, gpio=noop())
device = max7219(serial, cascaded=2)
pixels = np.array([[000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000],
[000,000,000,255,255,000,000,000,000,000,000,255,255,000,000,000],
[000,000,255,000,000,255,000,000,000,000,255,000,000,255,000,000],
[000,255,000,000,000,000,255,000,000,255,000,000,000,000,255,000],
[000,255,000,000,255,000,255,000,000,255,000,000,255,000,255,000],
[000,255,000,255,255,000,255,000,000,255,000,255,255,000,255,000],
[000,000,255,000,000,000,255,000,000,255,000,000,000,255,000,000],
[000,000,000,255,255,255,000,000,000,000,255,255,255,000,000,000]])
img = Image.fromarray(pixels, '1')
device.display(img)
Actual behaviour
Something (I can’t be sure what) flashes briefly across the displays. And that’s it. The code runs without errors, but nothing happens.
I have tried putting the display() command on an infinite loop, but still no result.
If I could be so bold, can an example of the correct usage be provided?
Thanks for any support you can provide (I am quite new on both python, raspberry pi and luma).
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
The examples work fine, and I even got an example you provided here on issues, that lights up random dots, four at a time.
No feedback, closing.