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

◆ bpm()

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

Definition at line 108 of file demoreel100.h.

108 {
109 // colored stripes pulsing at a defined Beats-Per-Minute (BPM)
110 u8 BeatsPerMinute = 62;
111 CRGBPalette16 palette = PartyColors_p;
112 u8 beat = beatsin8(BeatsPerMinute, 64, 255);
113 for (u16 i = 0; i < mNumLeds; i++) {
114 leds[i] =
115 ColorFromPalette(palette, hue + (i * 2), beat - hue + (i * 10));
116 }
117 }
fl::CRGB leds[NUM_LEDS]
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_NOEXCEPT
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)

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

+ Here is the call graph for this function: