I use a mod of the blink program to drive an ESP8266 output dependent of the state of a declared input pin. While the output does work when assigned to the blink program, when using a condition dependant on the state of a declared input pin the corresponding output does not react.
What do I stupidly do wrong?
int outPin=13;
int inPin=14;
void setup() {
pinMode(outPin, OUTPUT);
digitalWrite(outPin, LOW);
pinMode(inPin, INPUT);
}
void loop() {
if(inPin==HIGH)
{delay(50);
digitalWrite(outPin, HIGH); } // Turn the LED on (Note that LOW is the voltage level
// but actually the LED is on; this is because
if(inPin==LOW) // it is acive low)
{delay(50);
digitalWrite(outPin, LOW); } // Turn the LED off by making the voltage HIGH
}