From 509f9f27a3db72de0e508f78529995d591aec380 Mon Sep 17 00:00:00 2001 From: bton Date: Wed, 10 Apr 2024 20:50:30 +0200 Subject: [PATCH] OLED test --- oled.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 oled.py diff --git a/oled.py b/oled.py new file mode 100644 index 0000000..65350bd --- /dev/null +++ b/oled.py @@ -0,0 +1,12 @@ +from luma.core.interface.serial import i2c, spi, pcf8574 +from luma.core.interface.parallel import bitbang_6800 +from luma.core.render import canvas +from luma.oled.device import ssd1306, ssd1309, ssd1325, ssd1331, sh1106, sh1107, ws0010 + +serial = i2c(port=1, address=0x3C) + +device = ssd1306(serial) + +with canvas(device) as draw: + draw.rectangle(device.bounding_box, outline="white", fill="black") + draw.text((30, 40), "Hello World", fill="white")