complete beginner here, I was wondering if it's possible to simplify this code, to thin it down or shorten it up.
As you can easily tell, this thing makes one led turn on when the other is off and viceversa, in a loop.
void setup()
{
pinMode(3, OUTPUT);
pinMode(13, OUTPUT);
}
void loop()
{
digitalWrite(13, HIGH);
if (digitalRead(13) == HIGH)
digitalWrite(3, LOW);
delay(1000); // Wait for 1000 millisecond(s)
digitalWrite(13, LOW);
if (digitalRead(13) == LOW)
digitalWrite(3, HIGH);
delay(1000); // Wait for 1000 millisecond(s)
}