From 06b8730af80f4441635b9f16cb0c967d4074e486 Mon Sep 17 00:00:00 2001 From: Daniel Thompson Date: Thu, 23 Jan 2020 19:36:48 +0000 Subject: [PATCH] wasp: Turn-key demo Press ^C to terminate the demo and start programming in python! --- wasp/demo.py | 27 +++++++++++++++++++++++++++ wasp/main.py | 2 ++ 2 files changed, 29 insertions(+) create mode 100644 wasp/demo.py create mode 100644 wasp/main.py diff --git a/wasp/demo.py b/wasp/demo.py new file mode 100644 index 0000000..b8477db --- /dev/null +++ b/wasp/demo.py @@ -0,0 +1,27 @@ +# Simple alternating logo demo + +import pinetime, logo, time + +def run(): + colors = ( + 0xffff, + 0xf800, # red + 0xffff, + 0xffe0, # yellow + 0xffff, + 0x07e0, # green + 0xffff, + 0x07ff, # cyan + 0xffff, + 0x001f, # blue + 0xffff, + 0xf81f, # magenta + ) + + tft = pinetime.st7789() + + while True: + for c in colors: + tft.rleblit(logo.sx, logo.sy, logo.image, fg=c) + time.sleep(2) + diff --git a/wasp/main.py b/wasp/main.py new file mode 100644 index 0000000..9b96781 --- /dev/null +++ b/wasp/main.py @@ -0,0 +1,2 @@ +import demo +demo.run()