Every electronics journey starts with a blinking LED. In this lesson you install the Arduino IDE, connect your UNO R3 board and upload your first program, called a sketch.
What you'll learn
- How to install the Arduino IDE and select your board
- The structure of an Arduino sketch:
setup()andloop() - How to wire an LED safely with a resistor on a breadboard
What you need
- UNO R3 board and USB cable
- Breadboard
- 1 LED (any colour)
- 1 resistor, 220 Ω
- 2 jumper wires
Step 1: Install the Arduino IDE
- Download the Arduino IDE from arduino.cc/en/software and install it.
- Connect the UNO R3 to your computer with the USB cable. The green power LED on the board lights up.
- In the IDE, open Tools → Board and choose Arduino Uno.
- Open Tools → Port and choose the port that appeared when you plugged in the board (for example
COM3on Windows or/dev/cu.usbserial…on a Mac).
If no port appears, your board may use a CH340 USB chip. Install the CH340 driver for your operating system, then reconnect the board.
Step 2: Wire the LED
An LED has a long leg (the positive anode) and a short leg (the negative cathode). The resistor limits the current so the LED and the board pin aren't damaged.

| From | To |
|---|---|
| UNO pin 8 | Resistor, then the LED's long leg |
| LED short leg | UNO GND |
Step 3: Upload the sketch
const int LED_PIN = 8;
void setup() {
pinMode(LED_PIN, OUTPUT); // pin 8 drives the LED
}
void loop() {
digitalWrite(LED_PIN, HIGH); // LED on
delay(500); // wait half a second
digitalWrite(LED_PIN, LOW); // LED off
delay(500);
}
Click Upload (the right arrow). After a few seconds the IDE says "Done uploading" and your LED starts blinking.
How it works
setup() runs once when the board starts. loop() then runs again and again, forever. digitalWrite() switches the pin between 5 V (HIGH) and 0 V (LOW), and delay() pauses for a number of milliseconds.
Try this next
- Change both delays to 100 to make the LED blink fast.
- Add a second LED on pin 9 and make the two LEDs blink in turn, like a railway crossing.
Troubleshooting
- Upload fails: check that the right board and port are selected under Tools.
- LED stays off: turn the LED around. It only conducts in one direction.