mt12/SCRIPTS/RGBLED/police.lua

27 lines
594 B
Lua
Raw Normal View History

2025-06-26 07:54:22 -04:00
local function init()
police_oldtime = getTime()
police_cycle = 0
end
local function run()
for i=0, LED_STRIP_LENGTH - 1, 1
do
if (i % 2 == police_cycle) then
setRGBLedColor(i, 0, 0, 50)
else
setRGBLedColor(i, 50, 0, 0)
end
end
if ((getTime() - police_oldtime) > 8) then
police_oldtime = getTime()
police_cycle = 1 - police_cycle
end
applyRGBLedColors()
end
local function background()
-- Called periodically while the Special Function switch is off
end
return { run=run, background=background, init=init }