Revert "try to import bitbangio if busio SPI is not available"
This commit is contained in:
parent
be5b20480c
commit
e708de0a64
1 changed files with 2 additions and 8 deletions
|
|
@ -84,24 +84,18 @@ class DotStar:
|
|||
def __init__(self, clock, data, n, *, brightness=1.0, auto_write=True,
|
||||
pixel_order=BGR, baudrate=4000000):
|
||||
self._spi = None
|
||||
try:
|
||||
try:
|
||||
self._spi = busio.SPI(clock, MOSI=data)
|
||||
except (NotImplementedError, ValueError):
|
||||
import bitbangio
|
||||
self._spi = bitbangio.SPI(clock, MOSI=data)
|
||||
|
||||
while not self._spi.try_lock():
|
||||
pass
|
||||
self._spi.configure(baudrate=baudrate)
|
||||
|
||||
except (NotImplementedError, ValueError, ImportError):
|
||||
except (NotImplementedError, ValueError):
|
||||
self.dpin = digitalio.DigitalInOut(data)
|
||||
self.cpin = digitalio.DigitalInOut(clock)
|
||||
self.dpin.direction = digitalio.Direction.OUTPUT
|
||||
self.cpin.direction = digitalio.Direction.OUTPUT
|
||||
self.cpin.value = False
|
||||
|
||||
self._n = n
|
||||
# Supply one extra clock cycle for each two pixels in the strip.
|
||||
self.end_header_size = n // 16
|
||||
|
|
|
|||
Loading…
Reference in a new issue