How do I generate random numbers in a microcontroller efficiently? Are there any general guidelines or a particular fast method?
If the hardware has a button for the user, a simple trick is to count how long the button is pressed. With a fast enough short counter you get a "random" number.