bla
This commit is contained in:
+8
-6
@@ -13,6 +13,9 @@ import RPi.GPIO as GPIO
|
||||
# load needed modules from PIL
|
||||
from PIL import ImageFont, ImageDraw, Image
|
||||
|
||||
# load more needed modules
|
||||
import time
|
||||
|
||||
#GPIO define pins
|
||||
RST_PIN = 25 #Reset
|
||||
CS_PIN = 8
|
||||
@@ -23,19 +26,18 @@ device = sh1106(serial, rotate=2) #sh1106
|
||||
|
||||
oled_font = ImageFont.load_default()
|
||||
|
||||
def main()
|
||||
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)
|
||||
stamp = time.time()
|
||||
main()
|
||||
time.sleep(1)
|
||||
|
||||
except:
|
||||
print("Stopped", sys.exc_info()[0])
|
||||
raise
|
||||
raise
|
||||
GPIO.cleanup()
|
||||
Reference in New Issue
Block a user