-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLedFuse.h
More file actions
34 lines (25 loc) · 949 Bytes
/
LedFuse.h
File metadata and controls
34 lines (25 loc) · 949 Bytes
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
#ifndef LEDFUSE_HEADERGUARD
#define LEDFUSE_HEADERGUARD
#include "TaskScheduler.h"
#include "LedDisplay.h"
// Animates a burning fuse (count down) on the led display.
class LedFuse
{
public:
LedFuse(TaskScheduler& scheduler, LedDisplay& display);
~LedFuse();
bool ignite(uint16_t burnTime, uint32_t color); // Start the animation!
static void decrementFuse0(void* clientData); //should only be called by the taskScheduler.
private:
// Private functions
void decrementFuse();
// Private variables
TaskScheduler& m_scheduler;
LedDisplay& m_display;
uint32_t m_drawToken;
uint8_t m_ledIndex; //index of the next led to turn off
uint8_t m_numLedsOff; //The number of leds we have turned off so far
uint16_t m_delayBetweenTicks;
taskToken_t m_currentScheduledTask;
};//end LedFuse
#endif //LEDFUSE_HEADERGUARD