Skip to content

Commit 5d46945

Browse files
authored
Merge pull request #49 from FoamyGuy/triple_matrix_stuff
active3 simpletest
2 parents 792955c + 263f530 commit 5d46945

File tree

2 files changed

+48
-2
lines changed

2 files changed

+48
-2
lines changed

examples/rainbow_spiral_active3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
geometry = piomatter.Geometry(width=width, height=height, n_addr_lines=n_addr_lines, n_planes=10, n_temporal_planes=4, map=pixelmap, n_lanes=n_lanes)
3131
framebuffer = np.asarray(canvas) + 0 # Make a mutable copy
3232
matrix = piomatter.PioMatter(colorspace=piomatter.Colorspace.RGB888Packed,
33-
pinout=piomatter.Pinout.Active3,
33+
pinout=piomatter.Pinout.Active3BGR,
3434
framebuffer=framebuffer,
3535
geometry=geometry)
3636

@@ -66,7 +66,7 @@ def darken_color(hex_color, darkness_factor):
6666

6767
return darkened_hex_color
6868

69-
step_count = 4
69+
step_count = 8
7070
darkness_factor = 0.5
7171

7272
clearing = False
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/python3
2+
# SPDX-FileCopyrightText: 2025 Tim Cocks for Adafruit Industries
3+
#
4+
# SPDX-License-Identifier: MIT
5+
"""
6+
Display a simple test pattern of 3 shapes on three 64x64 matrix panels
7+
using Active3 compatible connections.
8+
9+
Run like this:
10+
11+
$ python triple_matrix_active3_simpletest.py
12+
13+
"""
14+
15+
import numpy as np
16+
from PIL import Image, ImageDraw
17+
18+
import adafruit_blinka_raspberry_pi5_piomatter as piomatter
19+
from adafruit_blinka_raspberry_pi5_piomatter.pixelmappers import simple_multilane_mapper
20+
21+
width = 64
22+
n_lanes = 6
23+
n_addr_lines = 5
24+
height = n_lanes << n_addr_lines
25+
pen_radius = 1
26+
27+
canvas = Image.new('RGB', (width, height), (0, 0, 0))
28+
draw = ImageDraw.Draw(canvas)
29+
30+
pixelmap = simple_multilane_mapper(width, height, n_addr_lines, n_lanes)
31+
geometry = piomatter.Geometry(width=width, height=height, n_addr_lines=n_addr_lines, n_planes=10, n_temporal_planes=4, map=pixelmap, n_lanes=n_lanes)
32+
framebuffer = np.asarray(canvas) + 0 # Make a mutable copy
33+
matrix = piomatter.PioMatter(colorspace=piomatter.Colorspace.RGB888Packed,
34+
pinout=piomatter.Pinout.Active3BGR,
35+
framebuffer=framebuffer,
36+
geometry=geometry)
37+
38+
39+
draw.rectangle((8, 8, width-8, width-8), fill=0x008800)
40+
draw.circle((32, 64+32), 22, fill=0x880000)
41+
draw.polygon([(32, 136), (54, 180), (10, 180)], fill=0x000088)
42+
43+
framebuffer[:] = np.asarray(canvas)
44+
matrix.show()
45+
46+
input("Press enter to exit")

0 commit comments

Comments
 (0)