/* 23/07/21 * delayMillisv2 * Problems of keeping exact time when work is introduced. */ int q; void setup() { // Serial.begin(9600) starts serial communication. 9600bps bits per second = 1200 characters per second Serial.begin(9600); //Send script name Serial.println("delayMillisv2..."); //this will print a blank line Serial.println(" "); } void loop(){ Serial.println("1st Item"); for(q=0;q<50;q++){ Serial.println(q); } //Delay stops all Arduino Activity for 2000 milliseconds (2 seconds) delay(2000); Serial.println("2nd Item"); //delay is now a random number between 500 and 2500 delay(random(500,2500)); //Delay stops all Arduino Activity for 2000 milliseconds (2 second) //delay(2000); Serial.println("3rd Item"); //Delay stops all Arduino Activity for 2000 milliseconds (2 second) delay(2000); }