/* 19/07/2021 ifelsev4 Purpose, to to learn nested if else */ //An int is an integer, a Number, any value between -32,768 and 32,767 int q; //start with a lower case letter, if a second word no spaces but start with a capital letter void setup() { // Serial.begin(9600) starts serial communication. 9600bps bits per second = 1200 characters per second Serial.begin(9600); //Send script name Serial.println("ifelsev4..."); //this will print a blank line Serial.println(" "); } void loop() { // print in the loop Serial.print("Val q: "); Serial.println(q); if (q >= 4) { if (q == 5) { Serial.println("q == 5"); }else{ Serial.println("q >= 4"); } } else { if (q != 4) { Serial.println("q != 4"); } if (q < 4) { Serial.println("q < 4 smaller than"); } } // ">" means greater than if (q > 10) { //change the value from 10 to 20 q = 0; } q++; delay(100); }