Tri-Color LED

daeg

Well-known member
Has anyone thought about using a 4-pin RGB LED with the Daisy?
types-of-rgb-min.jpeg

If we figured out how to connect 3 of those pins to the Daisy, send each pin a square wave and control the PWM of each square wave, we could have have and endless spectrum of colors available to us.
e0435fd452bbed155b5b3c5128b4f7c5.gif

I might create a thread on the topic over at the Daisy forum. Just wanted to get your guys input first.
 

daeg

Well-known member
Just checked the Terrarium. The LEDs are connected to Pin 22 and 23. Unfortunately there are only 2 DAC Outs.

Screen Shot 2021-11-04 at 6.16.39 PM.png
 

Robert

Reverse Engineer
Staff member
Although not quite as simple as driving them by DAC outputs, the Petal uses a PWM driver IC to control the RGB LEDs via I2C.

I believe soft PWM is also an option.
 

sonic_explorer

Active member
I have had success using RGB LEDs in a custom pcb I had made that is similar to the Terrarium. You could also attach some of the unused Daisy pins in the Terrarium build to the other RGB LED legs.

There is already a RgbLed function in the Daisy stuff, it is pretty easy to use once you point it to the correct pins for the RGB LED. I just used regular non-DAC pins on the Daisy to run these, although I do notice some excess noise. I don't know if the noise is from how I set things up or intrinsic to the software PWM (pulse width modulation).

Code:
RgbLed led1;
led1.Init(petal.seed.GetPin(Terrarium::LED_1R), // I define LED_1R as a specific pin in the terrarium.h file, similar to how the pots are defined.
              petal.seed.GetPin(Terrarium::LED_1G),
              petal.seed.GetPin(Terrarium::LED_1B),
              false); // This last term is true/false for common anode/cathode....but I don't remember which is true and false right now. 
led1.Set(1,0,0); // These 3 numbers are Red, Green & Blue from 0 to 1
led1.Update();
 
Top