added more stuff

This commit is contained in:
2021-07-30 14:19:42 +02:00
parent 1ea77a0d8b
commit 6d69bb8a64
+14
View File
@@ -1,3 +1,17 @@
#! /usr/bin/python3 #! /usr/bin/python3
# -*- coding: utf8 -*- # -*- coding: utf8 -*-
from luma.core.interface.serial import i2c, spi
from luma.core.render import canvas
from luma.oled.device import sh1106
from luma.core import lib
from PIL import ImageFont, ImageDraw, Image
serial = spi(device=0, port=0, bus_speed_hz = 8000000, transfer_size = 4096, gpio_DC = DC_PIN, gpio_RST = RST_PIN)
device = sh1106(serial, rotate=2) #sh1106
oled_font = ImageFont.truetype('FreeSans.ttf', 14)
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")