How do I generate random numbers in a microcontroller efficiently?

前端 未结 8 2079
梦毁少年i
梦毁少年i 2021-02-15 18:14

How do I generate random numbers in a microcontroller efficiently? Are there any general guidelines or a particular fast method?

8条回答
  •  执念已碎
    2021-02-15 19:18

    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.

提交回复
热议问题