Skip to content

Commit fe77023

Browse files
author
Mikey Sklar
committed
matrix8x8 working with dot by dot and ht16k33 library
1 parent 1bcc622 commit fe77023

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Matrix_7-Segment_LED_Backpack_Raspberry_Pi
2+
3+
Code to accompany this tutorial:
4+
https://learn.adafruit.com/matrix-7-segment-led-backpack-with-the-raspberry-pi/
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Import all board pins.
2+
import time
3+
import board
4+
import busio
5+
from adafruit_ht16k33 import matrix
6+
7+
# Create the I2C interface.
8+
i2c = busio.I2C(board.SCL, board.SDA)
9+
10+
# creates a 8x8 matrix:
11+
matrix = matrix.Matrix8x8(i2c)
12+
13+
# edges of an 8x8 matrix
14+
col_max = 8
15+
row_max = 8
16+
17+
# Clear the matrix.
18+
matrix.fill(0)
19+
col = 0
20+
row = 0
21+
22+
while True:
23+
24+
# illuminate a column one LED at a time
25+
while col < col_max:
26+
matrix[row, col] = 1
27+
col += 1
28+
time.sleep(.2)
29+
30+
# next row when previous column is full
31+
if row < row_max:
32+
row += 1
33+
col = 0
34+
35+
# clear matrix, start over
36+
else:
37+
row = col = 0
38+
matrix.fill(0)

0 commit comments

Comments
 (0)