Your first Arduino LED blink
Identify the three parts of the basic GPIO exercise: pin setup, output state and timing.
What you'll learn
- Understand the roles of setup() and loop().
- Configure LED_BUILTIN as a digital output.
- Alternate HIGH and LOW states with digitalWrite.
- Control visible timing with millisecond delays.
Components needed
- Arduino UnoOr a compatible documented board
- Built-in LEDNo external LED circuit required
- USB cablePower and sketch upload
- Arduino IDECorrect board and port selected
Circuit diagram
Circuit diagram placeholder
No external circuit is needed: this lesson uses the Uno’s documented built-in LED. Select LED_BUILTIN rather than assuming a pin number on another board.
Diagram coming soonCode
Study the highlighted firmware, then copy it into the matching development environment. Adapt board pins and initialization before compiling.
void setup() { pinMode(LED_BUILTIN, OUTPUT);}
void loop() { digitalWrite(LED_BUILTIN, HIGH); delay(500); digitalWrite(LED_BUILTIN, LOW); delay(500);}LED_BUILTIN selects the documented onboard LED pin. pinMode establishes it as an output, digitalWrite chooses its logic level, and delay blocks the sketch for the requested milliseconds. On the Uno, HIGH and LOW alternate the onboard LED state.
Simulate It
Run the circuit in your browser when a Wokwi simulation is connected to this lesson.
Wokwi simulation placeholder
Add the public Wokwi embed URL for this lab to launch the interactive simulator here.
wokwiEmbedUrl: "https://wokwi.com/projects/..."Expected Output
The built-in LED repeatedly turns on for 500 ms and off for 500 ms, producing one complete blink cycle every second.
Expected output image placeholder
Expected Arduino output placeholder showing the built-in LED blinking
Diagram coming soon07 · Challenge Task
Take this lab further
Create a heartbeat pattern: two quick 100 ms flashes separated by 100 ms, followed by a 700 ms pause.