-
Notifications
You must be signed in to change notification settings - Fork 0
/
fun.c
71 lines (60 loc) · 1.56 KB
/
fun.c
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
void mode_SingleColor(int8 c)
{
for(i = 0; i < NUMPIXELS; i++)
{
NeoRed[i] = rainbow[0][c];
NeoGreen[i] = rainbow[1][c];
NeoBlue[i] = rainbow[2][c];
}
NeoDraw();
delay_ms(40);
}
void mode_RGB()
{
tempR = 0; tempG = 0; tempB = 0;
for(int rgb = 0; rgb < 3; rgb++)
for(int16 temp = 1; temp < 256; temp++)
{
if(rgb == 0)
tempR = temp;
else
if(rgb == 1)
tempG = temp;
else
tempB = temp;
for(i = 0; i < NUMPIXELS; i++)
{
NeoRed[i] = tempR;
NeoGreen[i] = tempG;
NeoBlue[i] = tempB;
//delay_ms(100);
}
NeoDraw();
if(flag_break){
break;
}
delay_ms(50);
}
for(int rgb = 0; rgb < 3; rgb++)
for(temp = 255; temp > 0; temp--) {
if(rgb == 0)
tempR = temp;
else
if(rgb == 1)
tempG = temp;
else
tempB = temp;
for(i = 0; i < NUMPIXELS; i++) {
NeoRed[i] = tempR;
NeoGreen[i] = tempG;
NeoBlue[i] = tempB;
//delay_ms(100);
}
NeoDraw();
if(flag_break) {
break;
}
delay_ms(50);
}
flag_break = FALSE;
}