If statements and functions.
I am new to Arduino, can you help me please?
The sketch is supposed to only run "myfunction" if "EnableState" is high. However, it runs the function irrespective of the state of "EnableState"
Thanks for taking the time to read this.
bool EnableState; void setup() { // rem whatever EnableState = LOW; EnableState = HIGH; Serial.begin(9600); // opens serial port, sets data rate to 9600 bps } void loop() { Serial.println("In Void loop"); Serial.println(EnableState); if (EnableState==HIGH);{ MyFunction(); } } void MyFunction(){ Serial.println("MyFunction"); delay(1000); }