-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathARDUINO.ino
More file actions
30 lines (27 loc) · 809 Bytes
/
Copy pathARDUINO.ino
File metadata and controls
30 lines (27 loc) · 809 Bytes
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
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(7, INPUT);
pinMode(4, INPUT);
pinMode(5, INPUT);
pinMode(6, INPUT);
pinMode(13, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(13, HIGH);
digitalWrite(9, HIGH);
digitalWrite(10, LOW);
digitalWrite(11, LOW);
if(digitalRead(7) && digitalRead(6)) Serial.println("CLOSE");
else if(digitalRead(7)) Serial.println("TOGGLE");
else if(digitalRead(4)) Serial.println("RELOAD");
else if(digitalRead(6) && digitalRead(5)) Serial.println("LR");
else if(digitalRead(6)) Serial.println("LEFT");
else if(digitalRead(5)) Serial.println("RIGHT");
else Serial.println("NONE");
delay(125);
}