Secure, that the 'space' leds in the middle are only positive numbers

This commit is contained in:
ollo 2017-12-29 21:47:23 +01:00
parent b597441192
commit f2b625f0cb

View File

@ -7,7 +7,8 @@ counter1=0
ws2812.write(string.char(0,0,0):rep(114)) ws2812.write(string.char(0,0,0):rep(114))
tmr.alarm(2, 85, 1, function() tmr.alarm(2, 85, 1, function()
counter1=counter1+1 counter1=counter1+1
ws2812.write(string.char(128,0,0):rep(counter1) .. string.char(0,0,0):rep(MAXLEDS - (counter1*2)) .. string.char(0,0,64):rep(counter1)) spaceLeds = math.max(MAXLEDS - (counter1*2), 0)
ws2812.write(string.char(128,0,0):rep(counter1) .. string.char(0,0,0):rep(spaceLeds) .. string.char(0,0,64):rep(counter1))
end) end)
local blacklistfile="init.lua config.lua config.lua.new" local blacklistfile="init.lua config.lua config.lua.new"
@ -54,3 +55,4 @@ tmr.alarm(1, 5000, 0, function()
print("No Main file found") print("No Main file found")
end end
end) end)
print("Init file end reached")