Skip to content

Commit 8a4ff66

Browse files
committed
Use board.SPI() instead of busio.SPI
1 parent e4abdcd commit 8a4ff66

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

examples/max7219_custommatrixtest.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,14 @@
33

44
import time
55
import board
6-
import busio
76
import digitalio
87
from adafruit_max7219 import matrices
98

9+
1010
# You may need to change the chip select board depending on your wiring
11-
mosi = board.MOSI
12-
clk = board.CLK
11+
spi = board.SPI()
1312
cs = digitalio.DigitalInOut(board.D4)
1413

15-
spi = busio.SPI(clk, MOSI=mosi)
16-
1714
matrix = matrices.CustomMatrix(spi, cs, 32, 8)
1815
while True:
1916
print("Cycle Start")

examples/max7219_showbcddigits.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@
88
import digitalio
99
from adafruit_max7219 import bcddigits
1010

11+
1112
# You may need to change the chip select board depending on your wiring
12-
mosi = board.MOSI
13-
clk = board.CLK
13+
spi = board.SPI()
1414
cs = digitalio.DigitalInOut(board.D4)
1515

16-
spi = busio.SPI(clk, MOSI=mosi)
17-
1816
leds = bcddigits.BCDDigits(spi, cs, nDigits=8)
1917
while True:
2018
# clear display and dim 0

examples/max7219_simpletest.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,14 @@
33

44
import time
55
import board
6-
import busio
76
import digitalio
87
from adafruit_max7219 import matrices
98

9+
1010
# You may need to change the chip select board depending on your wiring
11-
mosi = board.MOSI
12-
clk = board.CLK
11+
spi = board.SPI()
1312
cs = digitalio.DigitalInOut(board.D4)
1413

15-
spi = busio.SPI(clk, MOSI=mosi)
16-
1714
matrix = matrices.Matrix8x8(spi, cs)
1815
while True:
1916
print("Cycle start")

0 commit comments

Comments
 (0)