Yes, I use a Kingbright WP154A4SUREQBFZGW
– a 4-terminal common kathode LED. For a schematic see: https://code.hfbk.net/sdiy/daisyy/daisyy-hardware/-/raw/main/images/schematic-1.jpg
I rule out hardware issues, it is on a soldered PCB that works flawlessly and very reliably with my DaisyDuino code. Here my Arduino RgbLed class from said code:
class RGBLed {
int pin_red;
int pin_green;
int pin_blue;
public:
RGBLed(int pin_red, int pin_green, int pin_blue);
void init();
void off();
void setColor(int r, int g, int b);
};
RGBLed::RGBLed(int pin_red, int pin_green, int pin_blue) {
this->pin_red = pin_red;
this->pin_green = pin_green;
this->pin_blue = pin_blue;
}
void RGBLed::init() {
pinMode(this->pin_red, OUTPUT);
pinMode(this->pin_green, OUTPUT);
pinMode(this->pin_blue, OUTPUT);
}
void RGBLed::off() {
digitalWrite(this->pin_red, LOW);
digitalWrite(this->pin_green, LOW);
digitalWrite(this->pin_blue, LOW);
}
void RGBLed::setColor(int r, int g, int b) {
r = min(255, max(0, r));
g = min(255, max(0, g));
b = min(255, max(0, b));
analogWrite(this->pin_red, r);
analogWrite(this->pin_green, g);
analogWrite(this->pin_blue, b);
}
Creating the object as follows:
// RGB LED R G B
RGBLed rgb_led = RGBLed(A10, A11, A9);
Of course this all boils down to the analogWrite
-function from arduino.h