//This program creates an LED sequence.
#define led1 2 //The first LED is on Arduino pin 2
#define led2 3 //The second LED is on Arduino pin 3
void setup() {
pinMode(led1, OUTPUT); //Set the pins controlling the LEDs to outputs
pinMode(led2, OUTPUT);
}
void loop() {
digitalWrite(led1, HIGH); //Turn on the first LED
delay(500); //Pause for half a second (1000ms=1s, 500ms=½s)
digitalWrite(led2, HIGH); //Turn on the second LED
delay(500); //Pause for half a second
digitalWrite(led1, LOW); //Turn off all LEDs
digitalWrite(led2, LOW);
delay(500); //Pause for half a second
}