Blink, rewritten to give pin 12 a name with the int command — clearer code, and you only change a pin in one place.
From the unit Crack the Code
· activity PRP 2: Digital input — Button
int LED = 12; // call pin 12 "LED" for the rest of this sketch
void setup() {
pinMode(LED, OUTPUT); // make the LED pin an output
}
void loop() { // runs over and over again, forever
digitalWrite(LED, HIGH); // turn the LED on
delay(1000); // wait for one second
digitalWrite(LED, LOW); // turn the LED off
delay(1000); // wait for one second
}
Shared from Little Bird Electronics curriculum.