FastLED 3.9.15
Loading...
Searching...
No Matches

◆ random8() [1/3]

LIB8STATIC fl::u8 random8 ( )

Generate an 8-bit random number.

Returns
random 8-bit number, in the range 0-255
Examples
ColorPalette.ino, DemoReel100.ino, Fire2012.ino, Fire2012WithPalette.ino, and ParallelSPI.ino.

Definition at line 53 of file random8.h.

53 {
55 // return the sum of the high and low bytes, for better
56 // mixing and non-sequential correlation
57 return (fl::u8)(((fl::u8)(rand16seed & 0xFF)) +
58 ((fl::u8)(rand16seed >> 8)));
59}
fl::u16 rand16seed
Seed for the random number generator functions.
#define APPLY_FASTLED_RAND16_2053(x)
Multiplies a value by the pseudo-random multiplier.
Definition random8.h:45
#define FASTLED_RAND16_13849
Increment value for pseudo-random number generation.
Definition random8.h:38
unsigned char u8
Definition stdint.h:131

References APPLY_FASTLED_RAND16_2053, FASTLED_RAND16_13849, FL_NOEXCEPT, LIB8STATIC, and rand16seed.

Referenced by addGlitter(), fl::DemoReel100::addGlitter(), fl::NoisePalette::changeToRandomPalette(), confetti(), fl::DemoReel100::confetti(), fl::Fire2012::draw(), Fire2012(), Fire2012WithPalette(), loop(), random8(), random8(), fl::PerlinParticlePunch::renderMeteor(), setup(), fl::NoisePalette::SetupRandomPalette(), SetupTotallyRandomPalette(), fl::Particles1d::Particle::spawn(), fl::PerlinParticlePunch::spawnAmbient(), fl::PerlinParticlePunch::spawnDebrisFromMeteor(), and triggerWaveRipple().

+ Here is the caller graph for this function: