#ifndef COMPILE_NOISEPLUSPALETTE
#if defined(__AVR__)
#define COMPILE_NOISEPLUSPALETTE 0
#else
#define COMPILE_NOISEPLUSPALETTE 1
#endif
#endif
#if COMPILE_NOISEPLUSPALETTE
#include "fx/2d/noisepalette.hpp"
#include "ui.h"
#define LED_PIN 3
#define BRIGHTNESS 96
#define LED_TYPE WS2811
#define COLOR_ORDER GRB
#define MATRIX_WIDTH 16
#define MATRIX_HEIGHT 16
#if __EMSCRIPTEN__
#define GRID_SERPENTINE 0
#else
#define GRID_SERPENTINE 1
#endif
#define NUM_LEDS (MATRIX_WIDTH * MATRIX_HEIGHT)
Slider SCALE(
"SCALE", 20, 1, 100, 1);
Slider SPEED(
"SPEED", 30, 1, 60, 1);
XYMap xyMap(MATRIX_WIDTH, MATRIX_HEIGHT, GRID_SERPENTINE);
NoisePaletteRef noisePalette = NoisePaletteRef::New(xyMap);
void setup() {
delay(1000);
noisePalette->
lazyInit();
noisePalette->
setSpeed(SPEED);
noisePalette->
setScale(SCALE);
}
void loop() {
noisePalette->setSpeed(SPEED);
noisePalette->setScale(SCALE);
}
#else
void setup() {}
void loop() {}
#endif
CFastLED FastLED
Global LED strip management instance.
central include file for FastLED, defines the CFastLED class/object
void setBrightness(uint8_t scale)
Set the global brightness scaling.
void show(uint8_t scale)
Update all our controllers with the current led colors, using the passed in brightness.
static CLEDController & addLeds(CLEDController *pLed, struct CRGB *data, int nLedsOrOffset, int nLedsIfOffset=0)
Add a CLEDController instance to the world.
void draw(DrawContext context) override
@ TypicalLEDStrip
Typical values for SMD5050 LEDs.
#define EVERY_N_MILLISECONDS(N)
Alias for EVERY_N_MILLIS.
Representation of an RGB pixel (Red, Green, Blue)