more stuff
This commit is contained in:
+17
-3
@@ -22,6 +22,20 @@ serial = spi(device=0, port=0, bus_speed_hz = 8000000, transfer_size = 4096, gpi
|
||||
device = sh1106(serial, rotate=2) #sh1106
|
||||
|
||||
oled_font = ImageFont.load_default()
|
||||
with canvas(device) as draw:
|
||||
draw.rectangle(device.bounding_box, outline = "white", fill = "black")
|
||||
draw.text((10, 10), "OLED-Display", font = oled_font, fill = "white")
|
||||
|
||||
def main()
|
||||
with canvas(device) as draw:
|
||||
draw.rectangle(device.bounding_box, outline = "white", fill = "black")
|
||||
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()
|
||||
Reference in New Issue
Block a user