34#define FL_ANIMARTRIX_USES_FAST_MATH 1
45#if !SKETCH_HAS_LOTS_OF_MEMORY
68#define COLOR_ORDER GRB
70#define MATRIX_WIDTH 64
71#define MATRIX_HEIGHT 64
73#define NUM_LEDS (MATRIX_WIDTH * MATRIX_HEIGHT)
75#define FIRST_ANIMATION POLAR_WAVES
79#define LED_DIAMETER 0.15
82#define POWER_LIMITER_ACTIVE
84#define POWER_MILLIAMPS 2000
104const bool kPowerLimiterActive =
false;
106void setup_max_power() {
107 if (kPowerLimiterActive) {
108 FastLED.setMaxPowerInVoltsAndMilliamps(POWER_VOLTS, POWER_MILLIAMPS);
114 Serial.begin(115200);
117 auto screen_map =
xyMap.toScreenMap();
118 screen_map.setDiameter(LED_DIAMETER);
121 .setScreenMap(screen_map);
126 colorOrder.onChanged([](
int value) {
128 case 0: value =
RGB;
break;
129 case 1: value =
RBG;
break;
130 case 2: value =
GRB;
break;
131 case 3: value =
GBR;
break;
132 case 4: value =
BRG;
break;
133 case 5: value =
BGR;
break;
141 uint32_t start = millis();
144 static int lastFxIndex = -1;
145 if (
fxIndex.value() != lastFxIndex) {
150 uint32_t
end = millis();
151 FL_WARN(
"*** DRAW TIME: " <<
int(
end - start) <<
"ms");
153 uint32_t end2 = millis();
154 FL_WARN(
"*** SHOW + DRAW TIME: " <<
int(end2 - start) <<
"ms");
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
central include file for FastLED, defines the CFastLED class/object
UITitle title("Audio Reactive Visualizations")
UIDescription description("Real-time audio visualizations with beat detection and multiple modes")
UISlider brightness("Brightness", 128, 0, 255, 1)
static XYMap constructRectangularGrid(u16 width, u16 height, u16 offset=0)
Manages and renders multiple visual effects (Fx) for LED strips.
fl::unique_ptr< Animartrix > animartrix
fl::unique_ptr< FxEngine > fxEngine
@ RBG
Red, Blue, Green (0021)
@ BGR
Blue, Green, Red (0210)
@ GBR
Green, Blue, Red (0120)
@ GRB
Green, Red, Blue (0102)
@ BRG
Blue, Red, Green (0201)
@ RGB
Red, Green, Blue (0012)
FastLED's Elegant JSON Library: fl::Json
@ TypicalLEDStrip
Typical values for SMD5050 LEDs.
constexpr T * end(T(&array)[N]) noexcept
Representation of an RGB pixel (Red, Green, Blue)
UINumberField fxIndex("Animartrix - index", 0, 0, NUM_ANIMATIONS)
UISlider timeSpeed("Time Speed", 1, -10, 10,.1)