Skip to content

Commit b0a6dda

Browse files
committed
drivers/display/lcd160cr: Fix bugs with lcd.get_pixel().
Fixes issues adafruit#2880 and adafruit#2881.
1 parent 8c5988b commit b0a6dda

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/display/lcd160cr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,13 @@ def set_pixel(self, x, y, c):
243243
self._fcmd2b('<BBBBH', 0x41, x, y, c)
244244

245245
def get_pixel(self, x, y):
246-
self._fcmd2b('<BBBB', 0x61, x, y)
246+
self._fcmd2('<BBBB', 0x61, x, y)
247247
t = 1000
248248
while t:
249249
self.i2c.readfrom_into(self.i2c_addr, self.buf1)
250250
if self.buf1[0] >= 2:
251251
self.i2c.readfrom_into(self.i2c_addr, self.buf[3])
252-
return self.buf[3][1] + self.buf[3][2] << 8
252+
return self.buf[3][1] | self.buf[3][2] << 8
253253
t -= 1
254254
sleep_ms(1)
255255
raise OSError(uerrno.ETIMEDOUT)

0 commit comments

Comments
 (0)