-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdoLights.lua
67 lines (53 loc) · 1.36 KB
/
doLights.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
print("do lights")
ws2812.init()
buffer = ws2812.newBuffer(300, 3)
buffer:fill(5, 5, 5)
--GRB
buffer:set(1, 0,51,51) --v
buffer:set(2, 0, 51, 153) --i
buffer:set(3, 0,0,255) --b
buffer:set(4, 255,0,0) --g
buffer:set(5, 255,255,0) --y
buffer:set(6, 51,204,0) --o
buffer:set(7, 0,255,0) --r
buffer:set(8, 0,51,51) --v
buffer:set(9, 0, 51, 153) --i
buffer:set(10, 0,0,255) --b
buffer:set(11, 255,0,0) --g
buffer:set(12, 255,255,0) --y
buffer:set(13, 51,204,0) --o
buffer:set(14, 0,255,0) --r
mytimer = tmr.create()
mytimer:register(80, tmr.ALARM_AUTO, function()
print("nyanCatLoop")
buffer:shift(1, ws2812.SHIFT_CIRCULAR)
ws2812.write(buffer)
end)
mytimer:start()
function nextRound(roundCounter)
if(roundCounter == 1) then
buffer = ws2812.newBuffer(300, 3)
buffer:fill(0,255,0)
--GRB
buffer:set(1, 0,51,51) --v
buffer:set(2, 0, 51, 153) --i
buffer:set(3, 0,0,255) --b
buffer:set(4, 255,0,0) --g
buffer:set(5, 255,255,0) --y
buffer:set(6, 51,204,0) --o
buffer:set(7, 0,255,0) --r
ws2812.write(buffer)
end
if(roundCounter == 2) then
end
if(roundCounter == 3) then
end
if(roundCounter == 4) then
end
if(roundCounter == 5) then
end
if(roundCounter == 6) then
end
if(roundCounter == 7) then
end
end