Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool d1 = 0;
- bool d2 = 0;
- bool d3 = 0;
- bool d4 = 0;
- int wires[4] = {8, 9, 10, 11};
- void setup() {
- Serial.begin(9600);
- for (int i = 0; i < 4; i++) { //15
- pinMode(wires[i], INPUT);
- Serial.print(wires[i]);
- Serial.print(",");
- }
- }
- void loop() {
- d1 = digitalRead(wires[0]);
- d2 = digitalRead(wires[1]);
- d3 = digitalRead(wires[2]);
- d4 = digitalRead(wires[3]);
- delay(50);
- if (d1 == 0 && d2 == 0 && d3 == 0 && d4 == 0 ) {
- Serial.println("[1] ----> *** OPEN ***");
- }
- else {
- Serial.println("[#] ----> System Closed");
- }
- delay(50);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement