From 92443291df060c49f8ef1eae08ed6bda68c83393 Mon Sep 17 00:00:00 2001 From: Peter Hinch Date: Sat, 27 Sep 2025 16:47:10 +0100 Subject: [PATCH] Update ePaper2in13V4.py to be compatible with nano_gui Adding these lines enables nano_gui demos to run (otherwise they raise an OSError "incompatible device driver"). --- pythonNanoGui/drivers/ePaper2in13V4.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pythonNanoGui/drivers/ePaper2in13V4.py b/pythonNanoGui/drivers/ePaper2in13V4.py index 9cfbb6d..0c3b985 100644 --- a/pythonNanoGui/drivers/ePaper2in13V4.py +++ b/pythonNanoGui/drivers/ePaper2in13V4.py @@ -17,6 +17,7 @@ import framebuf import uasyncio as asyncio from time import sleep_ms, ticks_ms, ticks_us, ticks_diff +from drivers.boolpalette import BoolPalette class EPD(framebuf.FrameBuffer): # A monochrome approach should be used for coding this. The rgb method ensures @@ -43,6 +44,7 @@ def __init__(self, spi, cs, dc, rst, busy, landscape=False, asyn=False, full=Tru self._buffer = bytearray(self.height * self.width // 8) self._mvb = memoryview(self._buffer) mode = framebuf.MONO_VLSB if landscape else framebuf.MONO_HLSB + self.palette = BoolPalette(mode) # Enable CWriter. super().__init__(self._buffer, self.width, self.height, mode) if self._full: self.init()