diff --git a/cores/esp32/WMath.cpp b/cores/esp32/WMath.cpp index fef0e94b..b1099b67 100644 --- a/cores/esp32/WMath.cpp +++ b/cores/esp32/WMath.cpp @@ -25,6 +25,7 @@ extern "C" { #include +#include "esp_system.h" } void randomSeed(unsigned long seed) @@ -39,7 +40,7 @@ long random(long howbig) if(howbig == 0) { return 0; } - return rand() % howbig; + return esp_random() % howbig; } long random(long howsmall, long howbig)