Skip to content

Commit e708de0

Browse files
authored
Revert "try to import bitbangio if busio SPI is not available"
1 parent be5b204 commit e708de0

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

adafruit_dotstar.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,23 +85,17 @@ def __init__(self, clock, data, n, *, brightness=1.0, auto_write=True,
8585
pixel_order=BGR, baudrate=4000000):
8686
self._spi = None
8787
try:
88-
try:
89-
self._spi = busio.SPI(clock, MOSI=data)
90-
except (NotImplementedError, ValueError):
91-
import bitbangio
92-
self._spi = bitbangio.SPI(clock, MOSI=data)
93-
88+
self._spi = busio.SPI(clock, MOSI=data)
9489
while not self._spi.try_lock():
9590
pass
9691
self._spi.configure(baudrate=baudrate)
9792

98-
except (NotImplementedError, ValueError, ImportError):
93+
except (NotImplementedError, ValueError):
9994
self.dpin = digitalio.DigitalInOut(data)
10095
self.cpin = digitalio.DigitalInOut(clock)
10196
self.dpin.direction = digitalio.Direction.OUTPUT
10297
self.cpin.direction = digitalio.Direction.OUTPUT
10398
self.cpin.value = False
104-
10599
self._n = n
106100
# Supply one extra clock cycle for each two pixels in the strip.
107101
self.end_header_size = n // 16

0 commit comments

Comments
 (0)