Example Code for Arduino-Blinking a LED
Last revision 2026/01/08
Turns on an LED on for one second, then off for one second, repeatedly.
Wiring Diagram

Sample Code
/*
# Description:
# Turns on an LED on for one second, then off for one second, repeatedly.
*/
int ledPin = 10;
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop() {
digitalWrite(ledPin,HIGH);
delay(1000);
digitalWrite(ledPin,LOW);
delay(1000);
}
Was this article helpful?
