From: Rachael Date: Sat, 15 Oct 2016 20:39:31 +0000 (-0700) Subject: shifty eyes v2 X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=8ea1acc0f4db9e2de85e75997b21fa5694cfe918;p=acmetensortoys-esp-lua_lamp shifty eyes v2 --- diff --git a/lamp-draw.lua b/lamp-draw.lua index 92986dd..e052d71 100644 --- a/lamp-draw.lua +++ b/lamp-draw.lua @@ -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)