Why is the output of this method different:
Seed is already initialized elsewhere...
generally a random number...
int randomCycleDelay()
{
int minimum = 2000;
int maximum = 60000;
int rd = abs(random(2000,60000));
return rd;
}
(generates 2000 all the time)
int randomCycleDelay()
{
int minimum = 2000;
int maximum = 60000;
int rd = abs(random(minimum,maximum));
return rd;
}
void setup() {
Serial.begin(115200); // Could be other values, too, but make sure it's the same as the monitor
randomSeed(analogRead(0));
}
void loop() {
Serial.println(randomCycleDelay());
}
long randomCycleDelay()
{
return random(2000,60000);
}
Did you bother to look at the range of values that can be stored in an int? Did you bother to actually print maximum to see what actually got stored in maximum?