Lesson 1Blink an LED
Open in SkyNex Lab →
You will learn: How a sketch is built (setup and loop), digital outputs and delay.
Parts and wiring
- ●Arduino Uno (USB to your computer)
- ●LED: Anode (+) → pin 13, GND → GND
How the code works
- 1setup() runs once: pinMode(LED_BUILTIN, OUTPUT) makes pin 13 an output.
- 2loop() runs again and again: digitalWrite(…, HIGH) switches the LED on, LOW switches it off.
- 3delay(1000) waits 1000 ms = 1 second between the two.
Show the code
// Blink
// The built-in LED (pin 13) turns on for 1 second, then off for 1 second.
void setup() {
pinMode(LED_BUILTIN, OUTPUT); // set the LED pin as an output
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // LED on
delay(1000); // wait 1000 ms = 1 second
digitalWrite(LED_BUILTIN, LOW); // LED off
delay(1000);
}
Try this
- Make it blink twice as fast.
- Make a short flash (100 ms on, 900 ms off).
- Move the LED to pin 8 (change the pin in the code and the wire).












































