From 8695b4fc91afd94085136e78acbde9381e21ccf2 Mon Sep 17 00:00:00 2001 From: fah <322496+fah@users.noreply.github.com> Date: Mon, 20 May 2019 20:47:22 +0200 Subject: [PATCH] Update secretOrderDoorOpener.ino --- secretOrderDoorOpener.ino | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/secretOrderDoorOpener.ino b/secretOrderDoorOpener.ino index 7f92704..55083fa 100644 --- a/secretOrderDoorOpener.ino +++ b/secretOrderDoorOpener.ino @@ -1,6 +1,7 @@ + const int NUMBER_OF_PINS = 3; const int buttonOrder[NUMBER_OF_PINS] = {11, 13, 11}; // order of the pins -boolean state[NUMBER_OF_PINS] = {false, false, false}; // remember of correct pins. if all are true relais will switch on. +boolean state[NUMBER_OF_PINS]; // remember of correct pins. If all are true -> relay will switch on. const int outputPin = 3; const int relayTime = 1000; // ms @@ -9,6 +10,7 @@ void setup() { for ( int i = 0; i < NUMBER_OF_PINS; i++ ) { pinMode(buttonOrder[i], INPUT_PULLUP); } + clear(); pinMode(outputPin, OUTPUT); Serial.println("Setup complete"); }