1
0
Fork 0
wasp-os/wasp/flashlight.py
Daniel Thompson b5b96bd776 wasp: Integrate the touch driver
At this point we are starting to bring an event model for applications
but there's still a long way to go!
2020-03-08 10:18:08 +00:00

34 lines
789 B
Python

import watch
import manager
from draw565 import Draw565
class FlashlightApp(object):
"""Trivial flashlight application.
Shows a pure white screen with the backlight set to maximum.
"""
def __init__(self):
self.backlight = None
def foreground(self, manager, effect=None):
"""Activate the application."""
self.on_screen = ( -1, -1, -1, -1, -1, -1 )
self.draw(effect)
manager.request_tick(1000)
def background(self):
"""De-activate the application (without losing state)."""
pass
def sleep(self):
return False
def tick(self, ticks):
pass
def draw(self, effect=None):
"""Redraw the display from scratch."""
display = watch.display
display.fill(0xffff)