-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrgb-swirl-6.sh
66 lines (50 loc) · 1.53 KB
/
rgb-swirl-6.sh
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
#!/bin/bash
led_write="/root/led_write.sh"
interval="0.02"
colors=( 0000ff ff00ff ff0000 ff9900 ffff00 00ff00 )
# Blue Purple Red Orange Yellow Green
while [ 1 ] #infinite loop
do
$led_write 0 ${colors[0]} #Assign primary colors
$led_write 1 ${colors[1]}
$led_write 2 ${colors[2]}
$led_write 3 ${colors[3]}
$led_write 4 ${colors[4]}
$led_write 5 ${colors[5]}
sleep $interval
$led_write 0 ${colors[1]} #Shift position
$led_write 1 ${colors[2]}
$led_write 2 ${colors[3]}
$led_write 3 ${colors[4]}
$led_write 4 ${colors[5]}
$led_write 5 ${colors[0]}
sleep $interval
$led_write 0 ${colors[2]} #Continue
$led_write 1 ${colors[3]}
$led_write 2 ${colors[4]}
$led_write 3 ${colors[5]}
$led_write 4 ${colors[0]}
$led_write 5 ${colors[1]}
sleep $interval
$led_write 0 ${colors[3]} #4
$led_write 1 ${colors[4]}
$led_write 2 ${colors[5]}
$led_write 3 ${colors[0]}
$led_write 4 ${colors[1]}
$led_write 5 ${colors[2]}
sleep $interval
$led_write 0 ${colors[4]} #5
$led_write 1 ${colors[5]}
$led_write 2 ${colors[0]}
$led_write 3 ${colors[1]}
$led_write 4 ${colors[2]}
$led_write 5 ${colors[3]}
sleep $interval
$led_write 0 ${colors[5]} #6
$led_write 1 ${colors[0]}
$led_write 2 ${colors[1]}
$led_write 3 ${colors[2]}
$led_write 4 ${colors[3]}
$led_write 5 ${colors[4]}
sleep $interval
done