-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlights.ino
47 lines (45 loc) · 992 Bytes
/
lights.ino
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
void operation_light()
{
Serial.println("To Toggle Light States, imput a number between 0 and 10...");
while(newData == false && commandTimeout >= 0)
{
//do nothing
delay(200);
commandTimeout--;
}
if(commandTimeout >= 0)
{
Serial.println("Command Timed out");
}
else
{
imputActual();
if(imputACT == 1 || 2 || 3 || 4 || 5)
{
state = digitalRead(imputACT + 48);
if(state == LOW)
{
digitalWrite(imputACT + 48, HIGH);
state = HIGH;
}
else
{
digitalWrite(imputACT + 48, LOW);
state = LOW;
}
}
else
{
Serial.println("Outside my range of lights");
}
}
Serial.print("Changed state of ");
Serial.print(imputACT);
Serial.print(" to ");
Serial.println(state);
delay(10);
imput = "";
state = LOW;
commandTimeout = 40;
Serial.println("Menu Closing");
}