int led_red = 10; // Pin for red
int led_green = 9; // Pin for green
 
void setup() {
  // Initialization of output pins for the LEDs
  pinMode(led_red, OUTPUT); 
  pinMode(led_green, OUTPUT); 
}
// Main program loop
void loop() {
  digitalWrite(led_red, HIGH); // Red LED is switched on
  digitalWrite(led_green, LOW); // green LED is switched off
  delay(3000); // Wait for 3 seconds
 
  digitalWrite(led_red, LOW); // Red LED is switched off
  digitalWrite(led_green, HIGH); // green LED is switched on
  delay(3000); // Wait for a further 3 seconds in which the LEDs are then switched over
}