//Generating random numbers on the serial screen.
long randNumber;
void setup(){
Serial.begin(9600);
randomSeed(analogRead(0)); //shuffles the random numbers
}
void loop() {
// print a random number from 0 to 299
randNumber = random(300);
Serial.println(randNumber);
// print a random number from 10 to 19
randNumber = random(10, 20);
Serial.println(randNumber);
delay(50);
}
No comments:
Post a Comment