Added Boot snake

This commit is contained in:
ollo 2016-06-18 19:12:31 +02:00
parent 07852a6f25
commit bab4c89d7b
2 changed files with 11 additions and 8 deletions

View File

@ -123,7 +123,7 @@ function generateLEDs(words, color)
else else
buf= buf .. white:rep(3) buf= buf .. white:rep(3)
end end
if (words.sechs == 1) then if (words.six == 1) then
buf= buf .. white:rep(2) buf= buf .. white:rep(2)
buf= buf .. color:rep(5) -- SECHS buf= buf .. color:rep(5) -- SECHS
buf= buf .. white:rep(1) buf= buf .. white:rep(1)

View File

@ -5,6 +5,7 @@ dofile("displayword.lua")
timezoneoffset=1 timezoneoffset=1
ledPin=4 ledPin=4
-- Color is defined as GREEN, RED, BLUE
color=string.char(0,0,250) color=string.char(0,0,250)
connect_counter=0 connect_counter=0
@ -44,10 +45,9 @@ tmr.alarm(0, 500, 1, function()
end end
end) end)
tmr.alarm(1, 5000, 1 ,function() tmr.alarm(1, 15000, 1 ,function()
sec, usec = rtctime.get() sec, usec = rtctime.get()
time = getTime(sec, timezoneoffset) time = getTime(sec, timezoneoffset)
print("Time : " , sec)
print("Local time : " .. time.year .. "-" .. time.month .. "-" .. time.day .. " " .. time.hour .. ":" .. time.minute .. ":" .. time.second) print("Local time : " .. time.year .. "-" .. time.month .. "-" .. time.day .. " " .. time.hour .. ":" .. time.minute .. ":" .. time.second)
words = display_timestat(time.hour, time.minute) words = display_timestat(time.hour, time.minute)
@ -55,10 +55,13 @@ tmr.alarm(1, 5000, 1 ,function()
-- Write the buffer to the LEDs -- Write the buffer to the LEDs
ws2812.write(ledPin, ledBuf) ws2812.write(ledPin, ledBuf)
-- Used for debugging
if (clockdebug ~= nil) then
for key,value in pairs(words) do for key,value in pairs(words) do
if (value > 0) then if (value > 0) then
print(key,value) print(key,value)
end end
end end
end
end) end)