FastLED 3.10.6
Loading...
Searching...
No Matches

◆ pride()

void pride ( )

Definition at line 49 of file Pride2015.ino.

50{
51 static uint16_t sPseudotime = 0;
52 static uint16_t sLastMillis = 0;
53 static uint16_t sHue16 = 0;
54
55 uint8_t sat8 = beatsin88( 87, 220, 250);
56 uint8_t brightdepth = beatsin88( 341, 96, 224);
57 uint16_t brightnessthetainc16 = beatsin88( 203, (25 * 256), (40 * 256));
58 uint8_t msmultiplier = beatsin88(147, 23, 60);
59
60 uint16_t hue16 = sHue16;//gHue * 256;
61 uint16_t hueinc16 = beatsin88(113, 1, 3000);
62
63 uint16_t ms = millis();
64 uint16_t deltams = ms - sLastMillis ;
65 sLastMillis = ms;
66 sPseudotime += deltams * msmultiplier;
67 sHue16 += deltams * beatsin88( 400, 5,9);
68 uint16_t brightnesstheta16 = sPseudotime;
69
70 for( uint16_t i = 0 ; i < NUM_LEDS; i++) {
71 hue16 += hueinc16;
72 uint8_t hue8 = hue16 / 256;
73
74 brightnesstheta16 += brightnessthetainc16;
75 uint16_t b16 = sin16( brightnesstheta16 ) + 32768;
76
77 uint16_t bri16 = (uint32_t)((uint32_t)b16 * (uint32_t)b16) / 65536;
78 uint8_t bri8 = (uint32_t)(((uint32_t)bri16) * brightdepth) / 65536;
79 bri8 += (255 - brightdepth);
80
81 CRGB newcolor = CHSV( hue8, sat8, bri8);
82
83 uint16_t pixelnumber = i;
84 pixelnumber = (NUM_LEDS-1) - pixelnumber;
85
86 nblend( leds[pixelnumber], newcolor, 64);
87 }
88}
CRGB leds[1]
#define 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_NO_EXCEPT
Generates a 16-bit sine wave at a given BPM that oscillates within a given range.
Definition beat.h:63
fl::u32 millis()
Universal millisecond timer - returns milliseconds since system startup.
unsigned char uint8_t
Definition stdint.h:208
fl::u32 uint32_t
Definition stdint.h:218
fl::u16 uint16_t
Definition stdint.h:213