Is there any way to use your library to drive regular RGB LEDs with

Is there any way to use your library to drive regular RGB LEDs with PWM? In particular, I’m interested in the really natural rainbow your HSV colour model provides.

Cheers

Yep! You bet. You can use the FastLED library’s HSV-to-RGB color conversion all by itself, even if you’re driving LEDs that the library doesn’t directly support.

For example, hook you could the R G and B connections from a single RGB LED to three PWM (“analog”) outputs of the Arduino. Then if you wanted to display an HSV color on the LED, you’d do this:

CHSV hsvColor( myHue, 255, 255);

CRGB rgbColor = hsvColor; // converts automatically

// now display the RGB color
analogWrite( redPin, rgbColor.red);
analogWrite( greenPin, rgbColor.green);
analogWrite( bluePin, rgbColor.blue);

I’ve done this myself actually. I have the three Arduino analog pins drive a trio of power transistors (MOSFETs), which in turn drive power to an ‘analog’ strip of 12v, non-addressable LEDS. I use FastLED library color functions to calculate gradients, crossfades, etc, and then just use analogWrite to send the color to the LEDs.

Hope this helps, and if you have more questions please do ask!

Perfect, that’s exactly what I was after. Thank you

I know this maybe a stupid qestion that was asked 6 years ago, however:
how can I dim / brighten a specific color e.g. in a DO loop?
Thank-you

While there is an archive of old Google+ FastLED content on Maker Forums, the FastLED community has requested that new conversation happen on Reddit: