// https://www.shellhacks.com/arduino-random-numbers-delay-randomseed/
void setup() {
Serial.begin(9600);
randomSeed(analogRead(7));
}
void loop() {
random1();
//random2();
}
void random1() {
// print a random number from 0 to 99
Serial.println(random(100));
// print a random number from 100 to 199
Serial.println(random(100, 200));
delay(1000);
}
void random2() {
// print a message with a random delay from 0 to 1000 milliseconds
Serial.println("Ping!");
delay(random(500));
// print a message with a random delay from 1000 to 60000 milliseconds
Serial.println("Pong!");
delay(random(500, 5000));
}