summaryrefslogtreecommitdiff
path: root/wasp
diff options
context:
space:
mode:
authorDaniel Thompson <daniel@redfelineninja.org.uk>2020-01-23 19:36:48 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2020-01-28 18:45:26 (GMT)
commit06b8730af80f4441635b9f16cb0c967d4074e486 (patch)
treea8e4d9fd0afa4f97589ff8e6153724be20fc59d6 /wasp
parent3157bcc3105d3a47e045ec8e0605d5dd31f807b1 (diff)
wasp: Turn-key demo
Press ^C to terminate the demo and start programming in python!
Diffstat (limited to 'wasp')
-rw-r--r--wasp/demo.py27
-rw-r--r--wasp/main.py2
2 files changed, 29 insertions, 0 deletions
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()