Posts

Showing posts from February, 2019

Random number generation on the ESP8266

Image
Soooo random! For an ESP8266 project that sends randomised tweets, I need to use a random number generator.  In such a deterministic system such as a digital computer however, true randomness is hard (impossible) to come by, so we must settle for a pseudo-random number - that is a number that is part of a seemingly random sequence and is generated algorithmically from the previous number(s) in the sequence.  It is good enough for our purposes.  The simplest implementation of a pseudo-random number generator (PRNG) is a Linear Congruential Generator , i.e. X n+1 = (aX n + c) mod m