I have found this:
https://github.com/rguillon/micropython ... dom/random
I think that it generates "pseudo random" numbers (I am not math guy....). It is good solution for my project. LEDs looks like blinking randomously .
Thank to everybody who answered to my question.
Search found 4 matches
- Fri Dec 16, 2016 8:04 pm
- Forum: MicroPython pyboard
- Topic: SOLVED - Pyboard lite does not generates random numbers
- Replies: 4
- Views: 6399
- Fri Dec 16, 2016 1:14 pm
- Forum: MicroPython pyboard
- Topic: SOLVED - Pyboard lite does not generates random numbers
- Replies: 4
- Views: 6399
Re: Pyboard generate random number
Thanks for your answer. But:
>>> import pyb
>>> pyb.rng()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'rng'
>>>
pyb.rng() is not accessible (last firmware 1.8.6).
>>> import pyb
>>> pyb.rng()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'rng'
>>>
pyb.rng() is not accessible (last firmware 1.8.6).
- Fri Dec 16, 2016 10:19 am
- Forum: MicroPython pyboard
- Topic: Random number generation?
- Replies: 4
- Views: 17372
Re: Random number generation?
Hi,
I want to achive similar result - blinking with random LED. But it not works with pyboard lite.
I tried import pyb. But help(pyb) do not list pyb.rng() method. Another solution?
Thanks
I want to achive similar result - blinking with random LED. But it not works with pyboard lite.
I tried import pyb. But help(pyb) do not list pyb.rng() method. Another solution?
Thanks
- Fri Dec 16, 2016 10:05 am
- Forum: MicroPython pyboard
- Topic: SOLVED - Pyboard lite does not generates random numbers
- Replies: 4
- Views: 6399
SOLVED - Pyboard lite does not generates random numbers
Hi,
I want to blink with with one random LED from numbers od LEDs. LEDs are connected to pyboard. In micropython-lib there is dummy module random without funcionality. Exists another solution for it - generate random number in pyboard?
Thanks.
I want to blink with with one random LED from numbers od LEDs. LEDs are connected to pyboard. In micropython-lib there is dummy module random without funcionality. Exists another solution for it - generate random number in pyboard?
Thanks.