diff options
| author | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-03-08 10:18:08 (GMT) |
|---|---|---|
| committer | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-03-08 10:18:08 (GMT) |
| commit | b5b96bd7760f76d9bb476eb835f49b3c9586ca5c (patch) | |
| tree | 2c9f5e9d4682a1efc870754d2e37d680f33925a2 /wasp/flashlight.py | |
| parent | 753a1e68f114772cd0fce765c7ec4770c8e34036 (diff) | |
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!
Diffstat (limited to 'wasp/flashlight.py')
| -rw-r--r-- | wasp/flashlight.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/wasp/flashlight.py b/wasp/flashlight.py new file mode 100644 index 0000000..d71342b --- /dev/null +++ b/wasp/flashlight.py @@ -0,0 +1,34 @@ +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) |
