Most the documentation I have found is using print for a random number generator but I can't get an idea of what to do. I need it for an array of leds. If someone has an idea of where to start let me know.
I'm trying to slow down a cycle of leds using randomseed(). I want to randomly choose a time in the array led cycle to slow down for 1 second. As you see I think I have the time issue sorted? Now I need to do the randomseed but I don't have a clue and anything I find to help is with numbers and print.
randomSeed (analogRead (0)); long oldperiod=period; // remember old period period=4500000;// set new slow period Timer1.setPeriod(period);// make it so delay(1000); //1 sec period=oldperiod; // put old period back Timer1.setPeriod(period); // make it so
can I use this somehow?
randOn = random (100, 1200); // generate ON time between 0.1 and 1.2 seconds randOff = random (200, 900); // generate OFF time between 0.2 and 0.9 seconds digitalWrite(ledPin, HIGH); // sets the LED on delay(randOn); // waits for a random time while ON digitalWrite(ledPin, LOW); // sets the LED off delay(randOff); // waits for a random time while OFF