Skip to content

Commit 523d1f4

Browse files
authored
Merge pull request #8 from deshipu/fix-readinto
There is no SPI.read(), only readinto()
2 parents 8feaafa + 3cf0e83 commit 523d1f4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

adafruit_rgb_display/rgb.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,11 @@ def _write(self, command=None, data=None):
131131
spi.write(data)
132132

133133
def _read(self, command=None, count=0):
134+
data = bytearray(count)
134135
self.dc.value = 0
135136
with self.spi_device as spi:
136137
if command is not None:
137138
spi.write(bytearray([command]))
138139
if count:
139-
data = spi.read(count)
140-
return data
140+
spi.readinto(data)
141+
return data

0 commit comments

Comments
 (0)