I have the following code:
void setup() {
pinMode(13, OUTPUT); // green
pinMode(12, OUTPUT); // blue
pinMode(11, OUTPUT); // red
}
void loop() {
digitalWrite(11, HIGH);
delay(1000);
digitalWrite(11, LOW);
delay(1000);
digitalWrite(12, HIGH);
delay(1000);
digitalWrite(12, LOW);
delay(1000);
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
delay(1000);
}
From where I stand, it should lighten LED 11, wait, turn off LED 11, wait, and repeat the same procedure for other components of LED light.
What it actually does: it looks like turn off for LEDs is lagging. It turns on one LED and than proceeds to turning on another LED before turning the first off. Eventually the first one is off, but I cannot predict, when it will happen.
If I do a blink sequence of each component separately, it works okay, though.
Can someone shed some light on this strange behavior, please?