This sketch is fully compatible with the FastLED web compiler.
This sketch is fully compatible with the FastLED web compiler. To use it do the following:
#define FL_ANIMARTRIX_USES_FAST_MATH 1
#if !SKETCH_HAS_LOTS_OF_MEMORY
#else
#define LED_PIN 3
#define BRIGHTNESS 32
#define COLOR_ORDER GRB
#define MATRIX_WIDTH 64
#define MATRIX_HEIGHT 64
#define NUM_LEDS (MATRIX_WIDTH * MATRIX_HEIGHT)
#define FIRST_ANIMATION POLAR_WAVES
#define LED_DIAMETER 0.15
#define POWER_LIMITER_ACTIVE
#define POWER_VOLTS 5
#define POWER_MILLIAMPS 2000
const bool kPowerLimiterActive = false;
void setup_max_power() {
if (kPowerLimiterActive) {
FastLED.setMaxPowerInVoltsAndMilliamps(POWER_VOLTS, POWER_MILLIAMPS);
}
}
Serial.begin(115200);
auto screen_map =
xyMap.toScreenMap();
screen_map.setDiameter(LED_DIAMETER);
.setScreenMap(screen_map);
setup_max_power();
colorOrder.onChanged([](int value) {
switch(value) {
case 0: value =
RGB;
break;
case 1: value =
RBG;
break;
case 2: value =
GRB;
break;
case 3: value =
GBR;
break;
case 4: value =
BRG;
break;
case 5: value =
BGR;
break;
}
});
}
uint32_t start = millis();
static int lastFxIndex = -1;
if (
fxIndex.value() != lastFxIndex) {
}
FL_WARN(
"*** DRAW TIME: " <<
int(
end - start) <<
"ms");
uint32_t end2 = millis();
FL_WARN(
"*** SHOW + DRAW TIME: " <<
int(end2 - start) <<
"ms");
}
#endif
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)