Read the code
Here is the whole sketch. A sketch is what Arduino calls a program10.
l1-blink-arduino.ino// Lesson 1, Arduino version.
// Blinks the UNO R3's LED on pin 13: 1 s on, 1 s off.
void setup() {
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
delay(1000);
}The first two lines start with //. They are notes for people, and the board ignores them11.
What each line does
void setup()The lines insidesetuprun once, when the board starts or is reset7.pinMode(13, OUTPUT);Makes pin 13 an output: a pin your code turns on and off9.void loop()Aftersetup, the lines insidelooprun again and again8.digitalWrite(13, HIGH);Turns pin 13 on, to 5 volts, so the light comes on3.delay(1000);Waits 1000 milliseconds, which is one second4.digitalWrite(13, LOW);Turns pin 13 off, to 0 volts, so the light goes out3.delay(1000);Waits one more second. Thenloopstarts again from its first line.
Want to change it? The Write code page starts with a Blink like this one. Change a delay number, press Run, and watch the speed change.