FastLED 3.10.8
Loading...
Searching...
No Matches

◆ bpm()

void fl::DemoReel100::bpm ( fl::span< CRGB > leds)
inlineprivate

Definition at line 110 of file demoreel100.h.

110 {
111 // colored stripes pulsing at a defined Beats-Per-Minute (BPM)
112 u8 BeatsPerMinute = 62;
113 CRGBPalette16 palette = PartyColors_p;
114 u8 beat = beatsin8(BeatsPerMinute, 64, 255);
115 for (u16 i = 0; i < mNumLeds; i++) {
116 leds[i] =
117 ColorFromPalette(palette, hue + (i * 2), beat - hue + (i * 10));
118 }
119 }
CRGB leds[1]
UINumberField palette("Palette", 0, 0, 2)
u16 mNumLeds
Definition fx.h:53
LIB8STATIC u8 beatsin8(accum88 beats_per_minute, u8 lowest=0, u8 highest=255, u32 timebase=0, u8 phase_offset=0) FL_NO_EXCEPT
Generates an 8-bit sine wave at a given BPM that oscillates within a given range.
Definition beat.h:105
const TProgmemRGBPalette16 PartyColors_p
HSV color ramp: blue, purple, pink, red, orange, yellow (and back).
unsigned char u8
Definition stdint.h:131
CRGB ColorFromPalette(const CRGBPalette16 &pal, fl::u8 index, fl::u8 brightness, TBlendType blendType) FL_NO_EXCEPT

References fl::beatsin8(), fl::ColorFromPalette(), fl::FL_NO_EXCEPT, hue, leds, fl::Fx::mNumLeds, palette(), and PartyColors_p.

+ Here is the call graph for this function: