You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like it is based on esp_random() which uses noise to more "truly" randomize numbers. This might seem like a good idea, but it actually breaks documented behavior. The spec even suggests:
"it can occasionally be useful to use pseudo-random sequences that repeat exactly."
I think it would be better to keep the defined Arduino behavior and give the user a way to opt for the ESP32 style randomization if desired, or perhaps documenting a technique to do so, such as setting a seed based on esp_random().
https://www.arduino.cc/reference/en/language/functions/random-numbers/randomseed/
it should be possible to create a repeatable sequence of pseudo-random numbers based on the same seed being used.
This does not seem to work on ESP32. Poking around, it looks like it is implemented here
https://github.com/espressif/arduino-esp32/blob/5be3ff74ea6057c7ee35fcc0cd60defb82786ec3/cores/esp32/WMath.cpp
It looks like it is based on esp_random() which uses noise to more "truly" randomize numbers. This might seem like a good idea, but it actually breaks documented behavior. The spec even suggests:
"it can occasionally be useful to use pseudo-random sequences that repeat exactly."
I think it would be better to keep the defined Arduino behavior and give the user a way to opt for the ESP32 style randomization if desired, or perhaps documenting a technique to do so, such as setting a seed based on esp_random().
Originally posted by @rsiemens77 in #7399
The text was updated successfully, but these errors were encountered: