void setup() {
  pinMode(2, OUTPUT);
  pinMode(4, OUTPUT);
}

void loop() {
  digitalWrite(2, HIGH);
  digitalWrite(4, LOW);
  delay(500);
  digitalWrite(2, LOW);
  digitalWrite(4, HIGH);
  delay(500);
}