You might want to look at your times.
You can turn all three ON at once, then have a single delay and turn them all OFF
void loop() {
digitalWrite(0, HIGH); // turn the Red LED On
delay(100); // wait for a second ******this is 100mS
digitalWrite(1, HIGH); // turn the Green LED On
delay(10); // wait for a second ******this is 10mS
digitalWrite(2, HIGH); // turn the Blue LED On
delay(100); // wait for a second ******this is 100mS
digitalWrite(0, LOW); // turn the Red LED off
digitalWrite(1, LOW); // turn the Green LED off
digitalWrite(2, LOW); // turn the Blue LED off
delay(1000); // wait for a second ******this is 1sec
}
To turn each on in turn try ..(*** untested ***)
void setup()
{
// initialize the LED pins as outputs
pinMode(0, OUTPUT);
pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
}
void loop()
{
digitalWrite(0, HIGH); // turn the Red LED ON
delay(2000); // wait 2 seconds
digitalWrite(0, LOW); // turn the Red LED OFF
delay(1000);
digitalWrite(1, HIGH); // turn the Green LED ON
delay(2000); // wait 2 seconds
digitalWrite(1, LOW); // turn the Green LED OFF
delay(1000);
digitalWrite(2, HIGH); // turn the Blue LED ON
delay(2000); // wait 2 seconds
digitalWrite(2, LOW); // turn the Blue LED OFF
delay(1000);
}
mark