Skip to content

Commit a5095d0

Browse files
authored
Merge pull request #13 from makermelissa/master
Fixed issue with TypeError when running on RPi
2 parents f22112d + 1240af2 commit a5095d0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

adafruit_ra8875/ra8875.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ def _write_data(self, data, raw=False):
222222
"""
223223
with self.spi_device as spi:
224224
spi.write(reg.DATWR) # pylint: disable=no-member
225+
if raw and isinstance(data, str):
226+
data = bytes(data, 'utf8')
225227
spi.write(data if raw else bytearray([data & 0xFF])) # pylint: disable=no-member
226228

227229
def _read_reg(self, cmd):

0 commit comments

Comments
 (0)