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

◆ pride

void pride ( NUM_LEDS )
Examples
FxPride2015.ino, and Pride2015.ino.

Definition at line 44 of file Pride2015.ino.

45{
46 static uint16_t sPseudotime = 0;
47 static uint16_t sLastMillis = 0;
48 static uint16_t sHue16 = 0;
49
50 uint8_t sat8 = beatsin88( 87, 220, 250);
51 uint8_t brightdepth = beatsin88( 341, 96, 224);
52 uint16_t brightnessthetainc16 = beatsin88( 203, (25 * 256), (40 * 256));
53 uint8_t msmultiplier = beatsin88(147, 23, 60);
54
55 uint16_t hue16 = sHue16;//gHue * 256;
56 uint16_t hueinc16 = beatsin88(113, 1, 3000);
57
58 uint16_t ms = millis();
59 uint16_t deltams = ms - sLastMillis ;
60 sLastMillis = ms;
61 sPseudotime += deltams * msmultiplier;
62 sHue16 += deltams * beatsin88( 400, 5,9);
63 uint16_t brightnesstheta16 = sPseudotime;
64
65 for( uint16_t i = 0 ; i < NUM_LEDS; i++) {
66 hue16 += hueinc16;
67 uint8_t hue8 = hue16 / 256;
68
69 brightnesstheta16 += brightnessthetainc16;
70 uint16_t b16 = sin16( brightnesstheta16 ) + 32768;
71
72 uint16_t bri16 = (uint32_t)((uint32_t)b16 * (uint32_t)b16) / 65536;
73 uint8_t bri8 = (uint32_t)(((uint32_t)bri16) * brightdepth) / 65536;
74 bri8 += (255 - brightdepth);
75
76 CRGB newcolor = CHSV( hue8, sat8, bri8);
77
78 uint16_t pixelnumber = i;
79 pixelnumber = (NUM_LEDS-1) - pixelnumber;
80
81 nblend( leds[pixelnumber], newcolor, 64);
82 }
83}
#define NUM_LEDS
fl::CRGB leds[NUM_LEDS]
CRGB & nblend(CRGB &existing, const CRGB &overlay, fract8 amountOfOverlay)
fl::hsv8 CHSV
Definition chsv.h:11
fl::CRGB CRGB
Definition crgb.h:25
LIB8STATIC u16 beatsin88(accum88 beats_per_minute_88, u16 lowest=0, u16 highest=65535, u32 timebase=0, u16 phase_offset=0) FL_NOEXCEPT
Generates a 16-bit sine wave at a given BPM that oscillates within a given range.
Definition beat.h:63
fl::u32 uint32_t
Definition s16x16x4.h:219
fl::u16 uint16_t
Definition s16x16x4.h:214
fl::u32 millis()
Universal millisecond timer - returns milliseconds since system startup.
unsigned char uint8_t
Definition s16x16x4.h:209

Referenced by loop().