Hi. I'm new at arduino and programming I wanna to learn it so i wrote a simple digital output for two leds to blink on and off in 1 second delay. I wanna add a third led to blink independent on those two in loop, but i don't know how to do it :~
There's a very simple example of how to blink a LED without using "delay()" in the examples in the IDE.
You can extend the technique to several LEDs, but I advise you to start with just two.
int led1 = 0;
int led2 = 1;
int led3 = 2;
void setup()
{
 pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
}
void loop()
{
 digitalWrite(led1, HIGH);
 delay(1000);
Â
 digitalWrite(led1, LOW);
Â
 digitalWrite(led2, HIGH);
 delay(1000);
Â
 digitalWrite(led2, LOW);
 delay(1000);
 digitalWrite(led3, HIGH);
 digitalWrite(led3, LOW);
}
Tnx for answers! Awol i don't understand what u mean with: without using "delay()" in the examples in the IDE. I just delete delay(); or how? Sorry i'm newbe
Look at the blink without delay example in the IDE.
It performs a slow flash of a LED without calling delay().
Play around with the example, and/or have a look at Nick Gammon's blink tutorial.