12#if defined(FL_IS_TEENSY)
17#if !SKETCH_HAS_LARGE_MEMORY
40float currentBPM = 0.0f;
49 }
else if (
bpm < 130.0f) {
60 Serial.println(
"Beat Detection Example");
61 Serial.println(
"=====================");
81 Serial.print(
"Onset strength=");
89 Serial.print(
" BPM (confidence: ");
94 Serial.println(
"Beat detector initialized");
95 Serial.println(
"Playing audio will trigger beat detection...");
110 if (timeSinceBeat < 100) {
112 fl::CRGB beatColor = getBPMColor(currentBPM);
114 }
else if (timeSinceBeat < 200) {
116 fl::CRGB beatColor = getBPMColor(currentBPM);
121 if (currentBPM > 0) {
123 float period_ms = (60000.0f / currentBPM);
127 fl::CRGB idleColor = getBPMColor(currentBPM);
141 Serial.println(
"=== Beat Detection Stats ===");
144 Serial.print(
" | Beats: ");
145 Serial.println(beatCount);
146 Serial.print(
"Current BPM: ");
147 Serial.println(currentBPM);
148 Serial.println(
"============================");
fl::UIAudio audio("Audio Input")
fl::audio::Processor audioProcessor
fl::UISlider brightness("Brightness", BRIGHTNESS, 0, 255)
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
static ScreenMap DefaultStrip(int numLeds, float cm_between_leds=1.5f, float cm_led_diameter=0.2f, float completion=.9f) FL_NOEXCEPT
void fill_solid(CRGB *targetArray, int numToFill, const CRGB &color) FL_NOEXCEPT
Fill a range of LEDs with a solid color.
#define EVERY_N_SECONDS(N)
Checks whether to execute a block of code every N seconds.
fl::u32 millis()
Universal millisecond timer - returns milliseconds since system startup.
void delay(u32 ms, bool run_async=true) FL_NOEXCEPT
Public delay wrapper that keeps bare Arduino delay() preferred after using fl::delay; while still all...
CRGB sample(const CRGB *grid, const XYMap &xyMap, float x, float y, SampleMode mode)
Sample a pixel from a 2D CRGB grid at floating-point coordinates.
enable_if<!is_integral< T >::value, T >::type fmod(T x, T y) FL_NOEXCEPT
enable_if< is_fixed_point< T >::value, T >::type sin(T angle) FL_NOEXCEPT
CRGB & fadeToBlackBy(u8 fadefactor) FL_NOEXCEPT
fadeToBlackBy is a synonym for nscale8(), as a fade instead of a scale
@ Green
<div style='background:#008000;width:4em;height:4em;'></div>
@ Red
<div style='background:#FF0000;width:4em;height:4em;'></div>
@ Blue
<div style='background:#0000FF;width:4em;height:4em;'></div>
Representation of an 8-bit RGB pixel (Red, Green, Blue)
Aggregator header for the fl/ui/ family of per-element UI types.