145{
148
149 for( uint16_t i = 0; i <
NUM_LEDS; i++) {
150 uint8_t threshold = scale8( sin8( wave), 20) + basethreshold;
151 wave += 7;
153 if( l > threshold) {
154 uint8_t overage = l - threshold;
155 uint8_t overage2 = qadd8( overage, overage);
156 leds[i] +=
fl::CRGB( overage, overage2, qadd8( overage2, overage2));
157 }
158 }
159}
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.
LIB8STATIC u8 beat8(accum88 beats_per_minute, u32 timebase=0) FL_NOEXCEPT
Generates an 8-bit "sawtooth" wave at a given BPM.