add an example for the 64x64 matrix
Some checks are pending
Pip / build (ubuntu-24.04-arm, 3.11) (push) Waiting to run
Pip / build (ubuntu-24.04-arm, 3.12) (push) Waiting to run
Pip / build (ubuntu-24.04-arm, 3.13) (push) Waiting to run
pre-commit / pre-commit (push) Waiting to run
Wheels / Build SDist (push) Waiting to run
Wheels / Wheels on ubuntu-24.04-arm (push) Waiting to run
Wheels / Upload release (push) Blocked by required conditions
Some checks are pending
Pip / build (ubuntu-24.04-arm, 3.11) (push) Waiting to run
Pip / build (ubuntu-24.04-arm, 3.12) (push) Waiting to run
Pip / build (ubuntu-24.04-arm, 3.13) (push) Waiting to run
pre-commit / pre-commit (push) Waiting to run
Wheels / Build SDist (push) Waiting to run
Wheels / Wheels on ubuntu-24.04-arm (push) Waiting to run
Wheels / Upload release (push) Blocked by required conditions
This commit is contained in:
parent
e7b277f6d8
commit
f1343c17a6
2 changed files with 26 additions and 1 deletions
25
examples/simpletest_addre_bgr.py
Normal file
25
examples/simpletest_addre_bgr.py
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
#!/usr/bin/python3
|
||||||
|
"""
|
||||||
|
Display a static 64x64 image
|
||||||
|
|
||||||
|
This assumes a 64x64 matrix with "BGR" pixel order, such as https://www.adafruit.com/product/5362
|
||||||
|
|
||||||
|
Run like this:
|
||||||
|
|
||||||
|
$ python simpletest.py
|
||||||
|
|
||||||
|
The image is displayed until the user hits enter to exit.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import pathlib
|
||||||
|
|
||||||
|
import adafruit_raspberry_pi5_piomatter as piomatter
|
||||||
|
import numpy as np
|
||||||
|
import PIL.Image as Image
|
||||||
|
|
||||||
|
geometry = piomatter.Geometry(width=64, height=64, n_addr_lines=5, rotation=piomatter.Orientation.Normal, n_planes=8)
|
||||||
|
framebuffer = np.asarray(Image.open(pathlib.Path(__file__).parent / "blinka64x64.png"))
|
||||||
|
matrix = piomatter.PioMatter(colorspace=piomatter.Colorspace.RGB888Packed, pinout=piomatter.Pinout.AdafruitMatrixBonnetBGR, framebuffer=framebuffer, geometry=geometry)
|
||||||
|
matrix.show()
|
||||||
|
|
||||||
|
input("Hit enter to exit")
|
||||||
|
|
@ -131,7 +131,7 @@ PYBIND11_MODULE(adafruit_raspberry_pi5_piomatter, m) {
|
||||||
m, "Pinout", "Describes the pins used for the connection to the matrix")
|
m, "Pinout", "Describes the pins used for the connection to the matrix")
|
||||||
.value("AdafruitMatrixBonnet", Pinout::AdafruitMatrixBonnet,
|
.value("AdafruitMatrixBonnet", Pinout::AdafruitMatrixBonnet,
|
||||||
"Adafruit Matrix Bonnet or Matrix Hat")
|
"Adafruit Matrix Bonnet or Matrix Hat")
|
||||||
.value("AdafruitMatrixBonnetBGR", Pinout::AdafruitMatrixBonnet,
|
.value("AdafruitMatrixBonnetBGR", Pinout::AdafruitMatrixBonnetBGR,
|
||||||
"Adafruit Matrix Bonnet or Matrix Hat with BGR color order")
|
"Adafruit Matrix Bonnet or Matrix Hat with BGR color order")
|
||||||
.value("AdafruitMatrixHat", Pinout::AdafruitMatrixBonnet,
|
.value("AdafruitMatrixHat", Pinout::AdafruitMatrixBonnet,
|
||||||
"Adafruit Matrix Bonnet or Matrix Hat")
|
"Adafruit Matrix Bonnet or Matrix Hat")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue