]> hydra-www.ietfng.org Git - acmetensortoys-esp-lua_lamp/commitdiff
shifty eyes v2
authorRachael <srbennett@gmail.com>
Sat, 15 Oct 2016 20:39:31 +0000 (13:39 -0700)
committerRachael <srbennett@gmail.com>
Sat, 15 Oct 2016 20:39:31 +0000 (13:39 -0700)
lamp-draw.lua

index 92986ddb57d8d0670365a4012d246ee96976a747..e052d71fdac227ef5aa2cbcce20c3538247310cb 100644 (file)
@@ -73,6 +73,28 @@ return {
       dodraw()
     end)
   end,
+  ["shifty_v2"] = function(t,fb,g,r,b)
+    t:unregister()
+    fb:fill(0,0,0)
+    local ix = 0
+    local c = string.char(g,r,b)
+    local b = string.char(0,0,0)
+    fb:set( 3,c) fb:set( 8,c) fb:set(10,c) fb:set(15,c)
+    fb:set(17,c) fb:set(18,c) fb:set(22,c) fb:set(23,c)
+    fb:set(27,c) fb:set(28,c) fb:set(29,c) fb:set(32,c)
+    t:register(1000,tmr.ALARM_AUTO, function()
+      if ix == 1
+        then fb:set( 1,c) fb:set( 3,b) fb:set( 6,c) fb:set( 8,b)
+            fb:set(17,b) fb:set(19,c) fb:set(22,b) fb:set(24,c)
+            fb:set(25,c) fb:set(27,b) fb:set(30,c) fb:set(32,b)
+       else fb:set( 1,b) fb:set( 3,c) fb:set( 6,b) fb:set( 8,c)
+            fb:set(17,c) fb:set(19,b) fb:set(22,c) fb:set(24,b)
+            fb:set(25,b) fb:set(27,c) fb:set(30,b) fb:set(32,c)
+      end
+      ix = 1 - ix
+      dodraw()
+    end)
+  end,
   ["snake"] = function(t,fb,g,r,b)
     local ix = 0
     local c = string.char(g,r,b)