I'm trying to separate my functions of my arduino FastLED project, and I want to put them into a class themselves. Now these "modes", as I call them, use some functions of the FastLED library.
The error I'm currently getting is that I use a function of an object of the FastLED library CRGB::white
, but I'm getting the error white is not a member of 'CRGB'
. It confuses me since I am able to use this syntax in the main arduino file, and I'm also able to use the functions of the library in the classes, with the same syntax as in the main file.
The mode class:
#include <FastLED.h>
class Mode {
public:
Mode (CRGB *l)
{
leds = l;
leds[random16(60)] += CRGB::white //Here the compiler gives an error about white not being a member of CRGB
}
protected:
CRGB *leds;
};
void setup()
{
leds[random16(60)] += CRGB::white //While over here it won't give an error.
}
My guess is to use a different syntax, but I can't seem to find it anywhere online...