]> hydra-www.ietfng.org Git - acmetensortoys-esp-lua_lamp/commitdiff
lamp-touch also directly writes to LED array
authorNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Sat, 23 Sep 2017 19:58:05 +0000 (15:58 -0400)
committerNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Sat, 23 Sep 2017 19:58:05 +0000 (15:58 -0400)
As part of blackout logic.  So it needs to bounce the enabling GPIO.

lamp-touch.lua

index 684c968b8d32756401e519d4c134d7e7be2051fe..5aac3f319c805bde98013191326cfe83b6d840b7 100644 (file)
@@ -37,7 +37,9 @@ local clear0 = function(o) return bit.band(o,0xFE) end
 local function setblackout(nb)
   if nb then
     isblackout = true
+    gpio.write(3,gpio.HIGH)
     ws2812.write(string.char(0):rep(32*3))
+    gpio.write(3,gpio.LOW)
     cap:mr(0x81,function(o) return bit.bor(o,0x03) end) -- breathe
     cap:mr(0x74,set0) -- drive
     cap:mr(0x72,clear0) -- unlink