pinMode(13, OUTPUT); for (;;) { if (digitalRead(2) == LOW) { digitalWrite(13, HIGH); } else { digitalWrite(13, LOW); } }