Tuesday, July 16, 2013

Generate pseudo-random numbers in Arduino


In Arduino, call random() function to generate pseudo-random numbers.
  • random(max)
  • random(min, max)
min - lower bound of the random value, inclusive (optional)
max - upper bound of the random value, exclusive

Returns
a random number between min and max-1 (long)

No comments:

Post a Comment