I currently achieved to integrate a slider in my code. It has a value range from 0…255 an basically I pass the value to a function that sets the brightness in my WLED implementation with “brigthness(int value)”:
Awesome thanks for the tip! This is what I came up with and it works:
extern "C" void color(int angle) {
// Normalize the angle to be between 0 and 360
angle = angle % 360;
int red, green, blue;
// Define color transitions based on the angle
if (angle < 120) {
red = map(angle, 0, 120, 255, 0);
green = map(angle, 0, 120, 0, 255);
blue = 0;
} else if (angle < 240) {
red = 0;
green = map(angle, 120, 240, 255, 0);
blue = map(angle, 120, 240, 0, 255);
} else {
red = map(angle, 240, 360, 0, 255);
green = 0;
blue = map(angle, 240, 360, 255, 0);
}
httpRequest("win&R="+String(red)+"&G="+String(green)+"&B="+String(blue)+"");
}
I have a slider with value 0…360 and I put this value in the “color(int angle)” function. There I split into R,G,B and call the WLED color change!