Example Code for Arduino-LED Blink

Last revision 2026/01/24

This article offers a detailed guide on how to make an LED blink using an Arduino setup, including hardware and software preparation, a wiring diagram, and a sample code for beginners.

Hardware Preparation

Software Preparation

Wiring Diagram

DFR0331_Led_Blink.png

Other Preparation Work

Open Arduino IDE, select Tools --> Board --> Intel Edison and Tools --> Serial Port --> COM xx.

Sample Code

Set pin13 as output, cycle levels to make LED blink every 1s.

int led = 13;

// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
  pinMode(led, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}

Result

The LED connected to pin 13 blinks once per second.

Was this article helpful?

TOP