Skip to content

Commit fbf0497

Browse files
committed
Fixate color animation
1 parent f46acd5 commit fbf0497

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/Animations/Color.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#pragma once
2+
3+
#include <FastLEDManager.h>
4+
5+
class Color : public Animation
6+
{
7+
public:
8+
using Animation::Animation;
9+
10+
void reset()
11+
{
12+
}
13+
14+
void loop()
15+
{
16+
fill_solid(FastLEDManager.leds, FastLEDManager.numLeds, strtol((const char *)&Config.color[0], NULL, 16));
17+
18+
FastLEDManager.show();
19+
}
20+
};

src/FastLEDManager.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
#include "Webserver.h"
99
#include "WebSocket.h"
1010

11+
#include "Animations/Color.h"
12+
1113
#include <ESPEssentials.h>
1214

1315

@@ -38,6 +40,8 @@ void FastLEDManagerClass::initialize(uint16_t numberOfLeds)
3840
Fade::initialize();
3941
}
4042

43+
registerAnimation(new Color("Color"));
44+
4145
registerSlider(new Slider("Brightness", 0, 255, 255, 1));
4246
registerSlider(new Slider("Speed", 0, 255, 127, 1));
4347
}

0 commit comments

Comments
 (0)