-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStatusLight
45 lines (40 loc) · 1.03 KB
/
StatusLight
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
//statuslight.c
//Include this in revelent programs
// Use #include "statuslight.c"
string color1 = "red";
string color2 = "none";
//this will show 'color1' for .5 sec then 'color2' and so on.
//THIS USES TIMER 2 SO DON'T USE IT OTHER PLACES
task blinker(){
time1[T2] = 0;
while(true){
if (color1 == "red"){
SensorType[RGB] = sensorCOLORRED;
}else if(color1 == "green"){
SensorType[RGB] = sensorCOLORGREEN;
}else if(color1 == "blue"){
SensorType[RGB] = sensorCOLORBLUE;
}else if(color1 == "all"){
SensorType[RGB] = sensorCOLORFULL;
}else{
SensorType[RGB] = sensorCOLORNONE;
}
while (time1[T2] < 500)
wait1Msec(1);
time1[T2] = 0;
if (color2 == "red"){
SensorType[RGB] = sensorCOLORRED;
}else if(color2 == "green"){
SensorType[RGB] = sensorCOLORGREEN;
}else if(color2 == "blue"){
SensorType[RGB] = sensorCOLORBLUE;
}else if(color2 == "all"){
SensorType[RGB] = sensorCOLORFULL;
}else{
SensorType[RGB] = sensorCOLORNONE;
}
while (time1[T2] < 500)
wait1Msec(1);
time1[T2] = 0;
}
}