diff --git a/LCD.py b/LCD.py index d788496..f304dfe 100644 --- a/LCD.py +++ b/LCD.py @@ -56,6 +56,13 @@ class LCD: for row in bitmap: self.lcd_byte(row, 1) + async def async_set_char(self, address, bitmap): + async with lock: + address = address * 8 + 0x40 + self.lcd_byte(address, 0) + for row in bitmap: + self.lcd_byte(row, 1) + def lcd_byte(self, bits, mode): # Send byte to data pins # bits = data diff --git a/animation.py b/animation.py index de2e51a..6a6489f 100644 --- a/animation.py +++ b/animation.py @@ -152,7 +152,7 @@ class animator: self.running = True while self.running: for slide in self.slides: - self.lcd.set_char(self.slot, slide) + await self.lcd.async_set_char(self.slot, slide) await asyncio.sleep(self.delay) async def stop(self):