Mercurial > code > home > repos > homeauto
changeset 384:5cdc6e85265f
start tiny_screen
Ignore-this: 3fb7ee4bea3f9f660fd275de2964afc4
author | drewp@bigasterisk.com |
---|---|
date | Tue, 01 Jan 2019 10:15:25 -0800 |
parents | 8f5a16a55f64 |
children | 6c5303b85948 |
files | service/tinyScreen/requrements.txt service/tinyScreen/tiny_screen.py |
diffstat | 2 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/service/tinyScreen/requrements.txt Tue Jan 01 10:15:25 2019 -0800 @@ -0,0 +1,1 @@ +luma.oled
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/service/tinyScreen/tiny_screen.py Tue Jan 01 10:15:25 2019 -0800 @@ -0,0 +1,11 @@ +from luma.core.interface.serial import spi +from luma.core.render import canvas +from luma.oled.device import ssd1331 + + +class Screen(object): + def __init__(self, spiDevice=1, rotation=0): + self._dev = ssd1331(spi(device=spiDevice, port=0), rotation=rotation) + with canvas(self._dev) as draw: + draw.rectangle(d.bounding_box, outline="white", fill="red") +