I have been messin around with some rgb lights, so i made a class RGBColor and declared the global variable currentColor but in loop() it gives me an error, not sure whats wrong with my code..
class RGBColor{
public:
byte r,g,b;
RGBColor(byte r, byte g, byte b)
{
this->r = r;
this->g = g;
this->b = b;
}
byte getRed(){
return r;
}
byte getGreen(){
return g;
}
byte getBlue(){
return b;
}
};
int LED_RED = 3;
int LED_GREEN = 5;
int LED_BLUE = 6;
RGBColor currentColor(0,0,0);
void setup() {
pinMode(LED_RED, OUTPUT);
pinMode(LED_GREEN, OUTPUT);
pinMode(LED_BLUE, OUTPUT);
}
void loop() {
analogWrite(LED_RED, curentColor.getRed());
}