Hi!
I'm working on coding a RGB led to fade from 1 set color to another. This has proven to be a lot more difficult than i expected it to be... The goal is to fade the white colour into the more orange one, but so far i haven't managed it yet. So far the fade worked but from yellow to white, guess this code desaturises the color. is there a way to do it the other way around?
This is the code I'm working with:
int redPin = 9;
int greenPin = 10;
int bluePin = 11;
uint8_t i = 0;
uint8_t f = 0;
void setup() {
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
Serial.begin(9600);
}
void loop() {
analogWrite(redPin, 250); // This is the white colour
analogWrite(greenPin, 250 );
analogWrite(bluePin, 255 );
i = i +2;
f++;
Serial.println(f);
Serial.println(i);
delay(10);
}