From 61c97d7a204d6f630c8d43fb8aca8f7dea48ed85 Mon Sep 17 00:00:00 2001 From: ollo Date: Wed, 18 May 2016 23:06:19 +0200 Subject: [PATCH] When minute4 is reached, all LEDs are set to zero --- main.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/main.lua b/main.lua index 0bb6b6c..b0d085e 100644 --- a/main.lua +++ b/main.lua @@ -35,6 +35,18 @@ tmr.alarm(1, 1000, 1 ,function() print("Local time : " .. time.year .. "-" .. time.month .. "-" .. time.day .. " " .. time.hour .. ":" .. time.minute .. ":" .. time.second) words = display_timestat(time.hour, time.minute) + -- All Leds are off + buf=string.char(0,0,0):rep(110) + + if (words.min4 == 1) then + buf=string.char(0,0,50):rep(110) + else + buf=string.char(0,0,0):rep(110) + end + + + ws2812.write(4, buf) + for key,value in pairs(words) do if (value > 0) then print(key,value)