first commit
This commit is contained in:
commit
5893b00dd2
1669 changed files with 1982740 additions and 0 deletions
30
libraries/FastLED/examples/FxTwinkleFox/FxTwinkleFox.ino
Normal file
30
libraries/FastLED/examples/FxTwinkleFox/FxTwinkleFox.ino
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#include "FastLED.h"
|
||||
#include "fx/1d/twinklefox.h"
|
||||
|
||||
using namespace fl;
|
||||
|
||||
#define NUM_LEDS 100
|
||||
#define LED_TYPE WS2811
|
||||
#define COLOR_ORDER GRB
|
||||
#define DATA_PIN 3
|
||||
#define VOLTS 12
|
||||
#define MAX_MA 4000
|
||||
|
||||
CRGBArray<NUM_LEDS> leds;
|
||||
TwinkleFox twinkleFox(NUM_LEDS);
|
||||
|
||||
void setup() {
|
||||
delay(3000); // safety startup delay
|
||||
FastLED.setMaxPowerInVoltsAndMilliamps(VOLTS, MAX_MA);
|
||||
FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS)
|
||||
.setCorrection(TypicalLEDStrip)
|
||||
.setRgbw();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
EVERY_N_SECONDS(SECONDS_PER_PALETTE) {
|
||||
twinkleFox.chooseNextColorPalette(twinkleFox.targetPalette);
|
||||
}
|
||||
twinkleFox.draw(Fx::DrawContext(millis(), leds));
|
||||
FastLED.show();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue