You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

39 lines
863 B

#ifndef _LED_H
#define _LED_H
//#define FASTLED_ALLOW_INTERRUPTS 0
//#define FASTLED_INTERRUPT_RETRY_COUNT 1
#include <FastLED.h>
#include "hardware.h"
class Led {
public:
Led(void);
void setup(void);
void changeAnimation(uint8_t num, uint16_t duration);
void changeColor(uint8_t, uint8_t, uint8_t);
void setBrightness(uint8_t);
void stop(void);
void wakeUpLight(uint8_t);
bool isOn();
private:
CRGB leds[NUM_LEDS];
void animationTask(void*);
static void cTaskWrapper(void*);
TaskHandle_t ledTaskHandle;
void (Led::*refresh)(void) = NULL;
void loop_steady(void);
void loop_rainbow(void);
void loop_confetti(void);
void loop_sweep(void);
void loop_off(void);
uint16_t duration;
uint8_t index;
uint8_t wakeupIndex;
CRGB color;
bool runTask;
};
#endif /* _LED_H */