Is there an issue with Random on ESP32?


#1

Hi,

I am running the ESP32 DevKitC, and I’d need a random number between 1 and 15. So I wrote the following:

Random tester

import streams
import random
streams.serial()
print random.randint(0, 5)

But this fails at compilation time:

error] Syntax error [invalid syntax (, line 10)] in [C:\Users\heikki.hietala\Random_tester\main.py] at line 9

I have located the Random.py file, and put that in the same folder ad my Main.py, but that one gives me a syntax error somewhere in the middle of the file.

Any help in sorting this out would be much appreciated.


#2

Hi @Heikki_Hietala,

in Zerynth Python random is a builtin function :slight_smile:


#3

My bad - I wasn’t able to locate it in the documentation. Many thanks!