more stuff

This commit is contained in:
2021-07-30 14:31:45 +02:00
parent 90f43355be
commit 82553abbb4
+14
View File
@@ -22,6 +22,20 @@ serial = spi(device=0, port=0, bus_speed_hz = 8000000, transfer_size = 4096, gpi
device = sh1106(serial, rotate=2) #sh1106 device = sh1106(serial, rotate=2) #sh1106
oled_font = ImageFont.load_default() oled_font = ImageFont.load_default()
def main()
with canvas(device) as draw: with canvas(device) as draw:
draw.rectangle(device.bounding_box, outline = "white", fill = "black") draw.rectangle(device.bounding_box, outline = "white", fill = "black")
draw.text((10, 10), "OLED-Display", font = oled_font, fill = "white") draw.text((10, 10), "OLED-Display", font = oled_font, fill = "white")
try:
while True:
stamp = time.time()
main()
time.sleep(1)
except:
print("Stopped", sys.exc_info()[0])
raise
GPIO.cleanup()