-
Notifications
You must be signed in to change notification settings - Fork 0
/
effects.h
91 lines (82 loc) · 2.63 KB
/
effects.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*
* effects.h - master include for LED effects
*/
extern boolean volatile breakEffect;
// from master file
void showStrip();
// Effect enums
enum EFFECTS {
OFF = 0,
SOLID,
FADEINOUT,
STROBE,
HALLOWEENEYES,
CYLONBOUNCE,
NEWKITT,
TWINKLE,
TWINKLERANDOM,
SPARKLE,
SNOWSPARKLE,
RUNNINGLIGHTS,
COLORWIPE,
RAINBOWCYCLE,
THEATRECHASE,
RAINBOWCHASE,
FIRE,
GRADIENTCYCLE,
BOUNCINGCOLOREDBALLS,
METEORRAIN,
SINELON,
BPM,
JUGGLE,
COLORCHASE,
CHRISTMASCHASE,
RAINBOWBOUNCE,
LAST_EFFECT = RAINBOWBOUNCE
};
typedef EFFECTS effects_t;
typedef struct EFFECT_NAME {
effects_t id;
char name[20];
} effect_name_t;
extern effect_name_t effects[];
extern const char *effect_names[];
// Fire effect static data (byte[numLEDs]) allocated at init
extern byte *heat[];
// LED effects
void solidColor(CRGB c);
void RGBLoop();
void FadeInOut();
void Strobe(CRGB c, int FlashDelay=50);
void HalloweenEyes(CRGB c, int EyeWidth, int EyeSpace, boolean Fade=true);
void eyeBounce(CRGB c, int EyeSizePct, int SweepsPerMinute=60);
void NewKITT(int EyeSizePct, int SweepsPerMinute=60);
void CenterToOutside(CRGB c, int EyeSizePct, uint8_t beat, boolean Fade=true);
void OutsideToCenter(CRGB c, int EyeSizePct, uint8_t beat, boolean Fade=true);
void LeftToRight(CRGB c, int EyeSizePct, uint8_t beat, boolean Fade=true);
void RightToLeft(CRGB c, int EyeSizePct, uint8_t beat, boolean Fade=true);
void Twinkle(int SpeedDelay, boolean OnlyOne=false);
void TwinkleRandom(int SpeedDelay, boolean OnlyOne=false);
void sinelon(int SpeedDelay=10);
void bpm(int SpeedDelay=10);
void juggle(int SpeedDelay=10);
void Sparkle(int SpeedDelay, CRGB c=CRGB::Black);
void snowSparkle(int SpeedDelay);
void runningLights(int WaveDelay);
void colorWipe(int WipesPerMinute=30, boolean Reverse=false);
void colorChase(CRGB c[], int Size=1, int SpeedDelay=50, boolean Reverse=false);
void christmasChase(int Size, int SpeedDelay=50, boolean Reverse=false);
void theaterChase(CRGB c, int SpeedDelay=50);
void gradientCycle(int SpeedDelay=10);
void rainbowCycle(int SpeedDelay=10);
void rainbowChase(int SpeedDelay=200);
void Fire(int Cooling, int Sparking, int SpeedDelay);
void bouncingColoredBalls(int BallCount, CRGB colors[]);
void meteorRain(byte meteorSizePct, byte meteorTrailDecay, boolean meteorRandomDecay, int SpeedDelay);
// Common Functions
void addGlitter(int zone, int section, fract8 chanceOfGlitter);
// private functions
unsigned int getPosFromPct(unsigned int pct, unsigned int ledsPerSection, byte width=1, bool Reverse=false);
void setPixelHeatColor(int zone, int Pixel, byte temperature);
CRGB * getRGBfromHue(byte hue);
CRGB * getRGBfromHeat(byte temp);