RGBLed
RGBLed copied to clipboard
Support for multiple LED's
Hi there. I am trying to control 3x CA RGB leds but it appears to be impossible.
#define R1_PIN 12
#define G1_PIN 14
#define B1_PIN 27
#define R2_PIN 26
#define G2_PIN 25
#define B2_PIN 33
#define R3_PIN 32
#define G3_PIN 13
#define B3_PIN 19
// Create instances of the RGBled class for each LED
RGBLed led1(R1_PIN, G1_PIN, B1_PIN, RGBLed::COMMON_ANODE);
RGBLed led2(R2_PIN, G2_PIN, B2_PIN, RGBLed::COMMON_ANODE);
RGBLed led3(R3_PIN, G3_PIN, B3_PIN, RGBLed::COMMON_ANODE);
led1.setColor(255, 0, 0);
led2.setColor(0, 255, 0);
led3.setColor(0, 0, 255);
Setting led3 to blue sets all 3 LED's to blue.
I am using an esp32.
Can this library only handle one led?
kind regards, Jean