HI,
I am quite new to arduino and have deciced to play around with some 12v rgb led strip(5m).
I am using TIP120 to be able to control each color.
I also use an external 12v power adapter
So far it has been working great. Execpt when I try to mix colours for a breathing effect. It works very good with blue and green and I get light blue, but red leds are much dimmer and when i try to fade blue and red at the same time it starts of great but then turns almost into pure blue because the blue leds overwhelm the reds at a certain point(from 0-255).
Has anyone got an idea how do I make blue leds dimmer during the fade.
Here is my code, sorry it is in my language but its only the variable names.
void setup() {
pinMode(9, OUTPUT);
pinMode(10,OUTPUT);
pinMode(11,OUTPUT);
}
void loop() {
dihanjeXY();
}
void dihanjeModra(){
int jakost = 0;
while(jakost < 255){
jakost+=3;
analogWrite(9, jakost);
delay(50);
}
delay(2000);
for(jakost; jakost >= 0; jakost-=3){
analogWrite(9, jakost);
delay(50);
}
delay(2000);
}
void dihanjeXY(){
int jakost = 0;
while(jakost < 255){
jakost+=3;
analogWrite(9, jakost-=50);
jakost+=50;
analogWrite(11, jakost);
delay(50);
}
delay(2000);
for(jakost; jakost >= 0; jakost-=3){
analogWrite(9, jakost-=50);
jakost+=50;
analogWrite(11, jakost);
delay(50);
}
delay(2000);
}
By the way, pins:
pin 9 = blue
pin 10 = green
pin 11 = red