2
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2025-12-24 06:28:23 +01:00

add oled-arm

This commit is contained in:
kev
2017-05-29 11:04:06 +08:00
parent f389f1d19e
commit d8c5610696
4 changed files with 66 additions and 0 deletions

13
oled/demo.py Normal file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python
from luma.core.interface.serial import i2c
from luma.core.render import canvas
from luma.oled.device import ssd1306
serial = i2c(port=1, address=0x3C)
device = ssd1306(serial)
device.cleanup = lambda _: None
with canvas(device) as draw:
draw.rectangle(device.bounding_box, outline="white", fill="black")
draw.text((30, 40), "Hello World", fill="white")