-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pl18): RGBLED LUA Scripts (#122)
- Loading branch information
1 parent
803c318
commit 98902e7
Showing
7 changed files
with
148 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
local function init() | ||
end | ||
|
||
local function run() | ||
for i=0, LED_STRIP_LENGTH - 1, 1 | ||
do | ||
setRGBLedColor(i, 0, 0, 50) | ||
end | ||
applyRGBLedColors() | ||
end | ||
|
||
local function background() | ||
-- Called periodically while the Special Function switch is off | ||
end | ||
|
||
return { run=run, background=background, init=init } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
local function init() | ||
end | ||
|
||
local function run() | ||
for i=0, LED_STRIP_LENGTH - 1, 1 | ||
do | ||
setRGBLedColor(i, 0, 50, 0) | ||
end | ||
applyRGBLedColors() | ||
end | ||
|
||
local function background() | ||
-- Called periodically while the Special Function switch is off | ||
end | ||
|
||
return { run=run, background=background, init=init } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
local function init() | ||
end | ||
|
||
local function run() | ||
for i=0, LED_STRIP_LENGTH - 1, 1 | ||
do | ||
setRGBLedColor(i, 0, 0, 0) | ||
end | ||
applyRGBLedColors() | ||
end | ||
|
||
local function background() | ||
-- Called periodically while the Special Function switch is off | ||
end | ||
|
||
return { run=run, background=background, init=init } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
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 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
local function init() | ||
end | ||
|
||
local function run() | ||
for i=0, LED_STRIP_LENGTH - 1, 1 | ||
do | ||
setRGBLedColor(i, 50, 0, 0) | ||
end | ||
applyRGBLedColors() | ||
end | ||
|
||
local function background() | ||
-- Called periodically while the Special Function switch is off | ||
end | ||
|
||
return { run=run, background=background, init=init } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
local function init() | ||
scroll_oldtime = getTime() | ||
scroll_cycle = LED_STRIP_LENGTH - 1 | ||
end | ||
|
||
local function run() | ||
for i=0, LED_STRIP_LENGTH - 1, 1 | ||
do | ||
if (i == scroll_cycle) then | ||
setRGBLedColor(i, 0, 50, 0) | ||
else | ||
setRGBLedColor(i, 0, 0, 50) | ||
end | ||
end | ||
if ((getTime() - scroll_oldtime) > 8) then | ||
scroll_oldtime = getTime() | ||
scroll_cycle = scroll_cycle - 1 | ||
if (scroll_cycle < 0) then | ||
scroll_cycle = LED_STRIP_LENGTH - 1 | ||
end | ||
end | ||
applyRGBLedColors() | ||
end | ||
|
||
local function background() | ||
-- Called periodically while the Special Function switch is off | ||
end | ||
|
||
return { run=run, background=background, init=init } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
local function init() | ||
scroll_oldtime = getTime() | ||
scroll_cycle = 0 | ||
end | ||
|
||
local function run() | ||
for i=0, LED_STRIP_LENGTH - 1, 1 | ||
do | ||
if (i == scroll_cycle) then | ||
setRGBLedColor(i, 0, 50, 0) | ||
else | ||
setRGBLedColor(i, 0, 0, 50) | ||
end | ||
end | ||
if ((getTime() - scroll_oldtime) > 8) then | ||
scroll_oldtime = getTime() | ||
scroll_cycle = scroll_cycle + 1 | ||
if (scroll_cycle >= LED_STRIP_LENGTH) then | ||
scroll_cycle = 0 | ||
end | ||
end | ||
applyRGBLedColors() | ||
end | ||
|
||
local function background() | ||
-- Called periodically while the Special Function switch is off | ||
end | ||
|
||
return { run=run, background=background, init=init } |