Skip to content

Commit 7ac79ae

Browse files
committed
Hide ESPEssentials
1 parent 3c2fb47 commit 7ac79ae

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,17 @@ Using FastLEDManager to manage your FastLED animations requires mainly three ste
7979

8080
void setup()
8181
{
82-
initESPEssentials("Project Name");
83-
FastLEDManager.initialize(NUM_LEDS);
82+
FastLEDManager.initialize("Project Name", NUM_LEDS);
8483
FastLEDManager.addLeds<LED_TYPE, LIGHTSTRIP_PIN, GRB>(FastLEDManager.hardwareLeds, NUM_LEDS);
8584
}
8685

8786
void loop()
8887
{
89-
handleESPEssentials();
9088
FastLEDManager.handle();
9189
}
9290
```
9391

94-
Change `NUM_LEDS`, `LED_TYPE` and `LIGHTSTRIP_PIN` according to your hardware configuration. `initESPEssentials("Project Name")` will initialize ESPEssentials which sets up all of the prerequisites for FastLEDManager. You may notice that this is not different than setting up a regular FastLED sketch apart from using `FastLEDManager` instead of `FastLED`.
92+
Change `NUM_LEDS`, `LED_TYPE` and `LIGHTSTRIP_PIN` according to your hardware configuration. You may notice that this is not different than setting up a regular FastLED sketch apart from using `FastLEDManager` instead of `FastLED`.
9593

9694
### Adding a new animation
9795

src/FastLEDManager.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ FastLEDManagerClass::FastLEDManagerClass() :
2626
{
2727
}
2828

29-
void FastLEDManagerClass::initialize(uint16_t numberOfLeds)
29+
void FastLEDManagerClass::initialize(String projectName, uint16_t numberOfLeds)
3030
{
31+
initESPEssentials(projectName);
3132
numLeds = numberOfLeds;
3233
leds = new CRGB[numLeds];
3334
hardwareLeds = new CRGB[numLeds];
@@ -69,6 +70,8 @@ void FastLEDManagerClass::enablePotentiometer(uint8_t pin)
6970

7071
void FastLEDManagerClass::handle()
7172
{
73+
handleESPEssentials();
74+
7275
if (!autostartHandled)
7376
autostart();
7477

src/FastLEDManager.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ class FastLEDManagerClass : public CFastLED
3434
void handle();
3535

3636
/// Initialize FastLEDManager
37-
void initialize(uint16_t numLeds);
37+
/// @param projectName Project name
38+
/// @param numLeds Number of LEDs
39+
void initialize(String projectName, uint16_t numLeds);
3840

3941
/// Initialize cycle button. The button will be used to cycle through animations.
4042
/// @param pin Button pin

0 commit comments

Comments
 (0)