Hello everyone,
I am trying to build out an idea here, and could really use some help knowing what function to call and the syntax around it.
Here’s what I’m going to do with this eventually:
I plan to use MOSFETS for each of the R, G, and B channels of a 4-pin LED strip (not individually addressable, just the IKEA Dioder lights) controlled via an Uno. I have a remote and IR sensor, and want to make it so I can configure the remote to trigger different “scenes.” For example, pressing button 1 would set the strip to red, button 2 would make it “breathe” from all the way off to fully Red, button 3 would do the same as button 2 but purple, and button 4 would crossfade the LEDs between purple and green. Each function would just repeat until a new button was pressed or the Arduino is unplugged.
To test out the base functionality while I wait on the FETs to be delivered, I am using just a single RGB LED and resistor type thing, with 3 pins connected to PWM slots on the board.
The question I have currently:
Is there a way to write a specific function to fade between two colors? Or even better, have a function that just looks at what the current color is, and then fades to an RGB value you pass it? For example, I have the LEDs set to a purple color. I call the function to have it change to teal rgb(0,127,128) and it smoothly fades over a time i’d set in ms from purple to “teal.” Then I can call the function again and have it fade to hot pink or something else. The color wouldn’t necessarily be one of the named colors in the FastLED library, though it sometimes would be.
I’ve messed around with the library as best I can, but I’m somewhat new to arduino and having trouble figuring out how to convert a lot of the examples i’m finding that seem to be for the individually addressable RGB strips, to a single LED strip (or at first, LED, until I put in the MOSFETs and have it control the whole strip)
If there is anyone that could help me by either pointing to a function of the library or possibly some code snippets for any or all of the above, I’d certainly be grateful.
Cheers,
Nathan