I'm using an ESP32. The sequence of numbers is different after each startup.
According to other forum entrys, the return value should always be the same?
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
randomSeed(10);
}
void loop() {
// put your main code here, to run repeatedly:
int rnd = random(1, 7);
Serial.println(rnd);
delay(1000); // this speeds up the simulation
}
the ESP32 has a true Random Number Generator (generated based on the noise of the WiFi / Bluetooth RF subsystem) and does not rely on mathematical series
possibly if you shut the WiFi and BT down then you'll get the same sequence
i was searching for another issue and casually looked the source code for esp8266... and noticed when randomSeed() was NEVER used, random() uses the hardware random generator instead
additionally in arduino, readAnalog() on a not initialized pin (for randomSeed()) does not generate enough noise and the result is a very short range of numbers... i am searching for the "von newmann" technique but couldn't find it