-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchristmas Tree code.lua
105 lines (92 loc) · 2.73 KB
/
christmas Tree code.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
row1 = 3
row2 = 0
row3 = 7
row4 = 4
row5 = 6
row6 = 8
gpio.mode(row1 , gpio.OUTPUT)
gpio.mode(row2 , gpio.OUTPUT)
gpio.mode(row3 , gpio.OUTPUT)
gpio.mode(row4 , gpio.OUTPUT)
gpio.mode(row5, gpio.OUTPUT)
gpio.mode(row6, gpio.OUTPUT)
while 1 do
gpio.write(row1, gpio.HIGH)
gpio.write(row2, gpio.LOW)
gpio.write(row3, gpio.HIGH)
gpio.write(row4, gpio.LOW)
gpio.write(row5, gpio.HIGH)
gpio.write(row6, gpio.LOW)
tmr.delay(1000000)
gpio.write(row1, gpio.LOW)
gpio.write(row2, gpio.HIGH)
gpio.write(row3, gpio.LOW)
gpio.write(row4, gpio.HIGH)
gpio.write(row5, gpio.LOW)
gpio.write(row6, gpio.HIGH)
tmr.delay(1000000)
gpio.write(row1, gpio.HIGH)
gpio.write(row2, gpio.HIGH)
gpio.write(row3, gpio.LOW)
gpio.write(row4, gpio.LOW)
gpio.write(row5, gpio.HIGH)
gpio.write(row6, gpio.HIGH)
tmr.delay(1000000)
gpio.write(row1, gpio.LOW)
gpio.write(row2, gpio.LOW)
gpio.write(row3, gpio.HIGH)
gpio.write(row4, gpio.HIGH)
gpio.write(row5, gpio.LOW)
gpio.write(row6, gpio.LOW)
tmr.delay(200000)
-- The Tree cascade down
gpio.write(row1, gpio.LOW)
gpio.write(row2, gpio.LOW)
gpio.write(row3, gpio.LOW)
gpio.write(row4, gpio.LOW)
gpio.write(row5, gpio.LOW)
gpio.write(row6, gpio.LOW)
tmr.delay(200000)
gpio.write(row1, gpio.HIGH)
gpio.write(row2, gpio.LOW)
gpio.write(row3, gpio.LOW)
gpio.write(row4, gpio.LOW)
gpio.write(row5, gpio.LOW)
gpio.write(row6, gpio.LOW)
tmr.delay(200000)
gpio.write(row1, gpio.HIGH)
gpio.write(row2, gpio.HIGH)
gpio.write(row3, gpio.LOW)
gpio.write(row4, gpio.LOW)
gpio.write(row5, gpio.LOW)
gpio.write(row6, gpio.LOW)
tmr.delay(200000)
gpio.write(row1, gpio.HIGH)
gpio.write(row2, gpio.HIGH)
gpio.write(row3, gpio.HIGH)
gpio.write(row4, gpio.LOW)
gpio.write(row5, gpio.LOW)
gpio.write(row6, gpio.LOW)
tmr.delay(200000)
gpio.write(row1, gpio.HIGH)
gpio.write(row2, gpio.HIGH)
gpio.write(row3, gpio.HIGH)
gpio.write(row4, gpio.HIGH)
gpio.write(row5, gpio.LOW)
gpio.write(row6, gpio.LOW)
tmr.delay(200000)
gpio.write(row1, gpio.HIGH)
gpio.write(row2, gpio.HIGH)
gpio.write(row3, gpio.HIGH)
gpio.write(row4, gpio.HIGH)
gpio.write(row5, gpio.HIGH)
gpio.write(row6, gpio.LOW)
tmr.delay(200000)
gpio.write(row1, gpio.HIGH)
gpio.write(row2, gpio.HIGH)
gpio.write(row3, gpio.HIGH)
gpio.write(row4, gpio.HIGH)
gpio.write(row5, gpio.HIGH)
gpio.write(row6, gpio.HIGH)
tmr.delay(200000)
end