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

◆ random8() [1/3]

LIB8STATIC uint8_t 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 NoisePlusPalette.ino.

Definition at line 44 of file random8.h.

44 {
46 // return the sum of the high and low bytes, for better
47 // mixing and non-sequential correlation
48 return (uint8_t)(((uint8_t)(rand16seed & 0xFF)) +
49 ((uint8_t)(rand16seed >> 8)));
50}
uint16_t rand16seed
Seed for the random number generator functions.
Definition lib8tion.cpp:17
#define APPLY_FASTLED_RAND16_2053(x)
Multiplies a value by the pseudo-random multiplier.
Definition random8.h:36
#define FASTLED_RAND16_13849
Increment value for pseudo-random number generation.
Definition random8.h:29

References APPLY_FASTLED_RAND16_2053, FASTLED_RAND16_13849, LIB8STATIC, and rand16seed.

Referenced by addGlitter(), fl::DemoReel100::addGlitter(), fl::NoisePalette::changeToRandomPalette(), confetti(), fl::DemoReel100::confetti(), fl::Fire2012::draw(), Fire2012(), Fire2012WithPalette(), random8(), random8(), fl::NoisePalette::SetupRandomPalette(), SetupRandomPalette(), and SetupTotallyRandomPalette().

+ Here is the caller graph for this function: