view service/tinyScreen/tiny_screen.py @ 1189:c1cf544711da

start tiny_screen Ignore-this: 3fb7ee4bea3f9f660fd275de2964afc4 darcs-hash:af475a8625caaad03e64f15ccf9d13ccd76b1323
author drewp <drewp@bigasterisk.com>
date Tue, 01 Jan 2019 10:15:25 -0800
parents
children c146fa2bc7d4
line wrap: on
line source

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")