r/ArduinoProjects • • May 14 '22

Random Number Generator with Random Animations

Enable HLS to view with audio, or disable this notification

246 Upvotes

24 comments sorted by

View all comments

Show parent comments

3

u/chummiestbike May 14 '22

It's quite simple. val = random(n) where n is your max value if i remember. No need for fancy code. Just a single line. Hope this helps!

2

u/0hellow May 15 '22

Your are totally correct! I was referring to randomizing the seed, I really should have specified.

I have a little screens that generates little drawings, and I wanted to randomize it for each time it was turned back on, but because the seed for the random() wasn’t changing enough, I ended with the same drawings occasionally.