/* 21/07/2021 forLoopv3 Purpose, nest for loops */ //An int is an integer, a Number, any value between -32,768 and 32,767 int q; int w; void setup() { // Serial.begin(9600) starts serial communication. 9600bps bits per second = 1200 characters per second Serial.begin(9600); //Send script name Serial.println("forLoopv3..."); //this will print a blank line Serial.println(" "); } void loop() { //Nested for loops Serial.println("Nested Loop"); //q starts with a value of Zero, the loop continues while q smaller than 20 for(q=0;q<20;q++){ for(w=10;w>-1;w--){ //print the value of q to the serial monitor Serial.print("Val q: "); Serial.print(q); Serial.print(" Val w: "); Serial.println(w); //delay within the for loop delay(100); } } //delay outside the for loop delay(1000); }