Holds all the parts and joins them, like a LEGO baseplate.
Breadboard
Our building board
setup() and loop() program structure
Blink an external LED on a half breadboard through a current-limiting resistor connected to pin 13.

Pin connections
| Part 1 | Part 2 | |
|---|---|---|
Resistor pin 1 | → | Breadboard 6t b |
Resistor pin 2 | → | Breadboard 10t b |
LED anode (+) | → | Breadboard 4t b |
LED cathode (-) | → | Breadboard 3t b |
Arduino pin 13 | → | Breadboard 10t e |
Breadboard 6t e | → | Breadboard 4t e |
Breadboard 3t e | → | Arduino GND |
Let's make a light blink!
Your very first program turns a tiny light on and off, over and over.
Blinking lights are everywhere — on TVs, toys, and even rockets!
The problem
Before we build cool robots, we need to learn how an Arduino program is put together.
Think of it like
setup() is like getting dressed in the morning — you do it once. loop() is like brushing your teeth every day — you do it again and again.
Holds all the parts and joins them, like a LEGO baseplate.
Breadboard
Our building board
It thinks and tells the light when to turn on and off.
Arduino
The brain
A tiny light that glows when it gets power.
LED
The light
Slows the power down so the light does not get hurt.
Resistor
The protector
setup() runs once
When the board turns on, setup() gets pin 13 ready. Then it never runs again.
void setup() {
pinMode(LED_PIN, OUTPUT);
}Turn the light ON
Pin 13 turns ON and the light glows.
digitalWrite(LED_PIN, HIGH);
Wait a little
The light stays on for half a second.
delay(500);
Turn it OFF and repeat
The light turns off, waits again, then loop() jumps back and does it all over — forever!
digitalWrite(LED_PIN, LOW); delay(500);
Then loop back to step 2
Follow these steps in order. Match the wires to the colors shown.
Place Breadboard
Place the Breadboard (bb1) on the breadboard.
Breadboard placed — build like the real world!
Place Arduino
Place the Arduino (uno) on the breadboard.
Arduino placed — ready to build!
Place Resistor
Place the Resistor (r1) on the breadboard.
Resistor plugged into the breadboard across columns 6 and 10!
Place LED
Place the LED (led1) on the breadboard.
LED plugged in — anode in column 4, cathode in column 3!
Connect Arduino pin 13 to Breadboard (bb1) 10t.e
Arduino pin 13 into the resistor's column 10 — use any free hole in that column
Tip: Arduino pin 13 into the resistor's column 10 — use any free hole in that column
Signal reaches the resistor through the breadboard!
Connect Breadboard (bb1) 6t.e to Breadboard (bb1) 4t.e
Jumper the resistor's column 6 to the LED's anode column 4 — any free hole in each column
Tip: Jumper the resistor's column 6 to the LED's anode column 4 — any free hole in each column
Resistor linked to the LED through the breadboard!
Connect Breadboard (bb1) 3t.e to Arduino GND
LED cathode column 3 straight to Arduino GND — any free hole in column 3
Tip: LED cathode column 3 straight to Arduino GND — any free hole in column 3
Circuit complete!
The light's nickname
const int LED_PIN = 13;
LED_PIN is a nickname for pin 13. Using the nickname makes the code easy to read.
setup() — runs once
void setup() {
pinMode(LED_PIN, OUTPUT);
}setup() runs one time when the board turns on. pinMode gets pin 13 ready to power the light.
loop() — blink forever
void loop() {
digitalWrite(LED_PIN, HIGH);
delay(500);
digitalWrite(LED_PIN, LOW);
delay(500);
}loop() turns the light on, waits, turns it off, waits — then starts over all by itself!
const int LED_PIN = 13;
void setup() {
pinMode(LED_PIN, OUTPUT);
}
void loop() {
digitalWrite(LED_PIN, HIGH);
delay(500);
digitalWrite(LED_PIN, LOW);
delay(500);
}
Q1. What does delay(500) do?
Q2. Which part runs only one time when the board turns on?
Make the light blink faster by making both delay numbers smaller.
Hint: Try 200 or 300 instead of 500.
Add a little note (comment) on the line that turns the light ON.
Hint: Type // and your words at the end of that line.
Add a note (comment) on line 1 that tells what LED_PIN is.
Hint: Like: // my light is on pin 13
A line-by-line tour of the sketch — the same steps as in Robot Gurukul Studio.
Program overview
Big idea
Every Arduino program has a top part, a setup() part that runs once, and a loop() part that runs again and again.
In this project
We make a little light blink on and off forever.
Tip
Read from the top to the bottom. Tap any word or line if you need help!
const int LED_PIN = 13;
setup()
Big idea
setup() runs one time when the board turns on.
In this project
It gets pin 13 ready for our light.
Why here
Things we do only once go inside setup().
void setup() {
pinMode(LED_PIN, OUTPUT);
}loop()
Big idea
loop() runs again and again, forever.
In this project
This is where the light blinks on and off.
Why here
Things that repeat go inside loop().
void loop() {
digitalWrite(LED_PIN, HIGH);
delay(500);
digitalWrite(LED_PIN, LOW);
delay(500);
}
Try this: Change a number inside loop(), then press Run to see what happens.
pinMode
Big idea
pinMode tells a pin if it will listen or push power out.
In this project
It makes pin 13 ready to push power to the light.
Why here
It goes in setup() because we only set it once.
pinMode(LED_PIN, OUTPUT);
digitalWrite
Big idea
digitalWrite turns a pin ON or OFF.
In this project
ON lights up the LED, OFF turns it dark.
Why here
It goes in loop() so the light can keep changing.
digitalWrite(LED_PIN, HIGH);
delay
Big idea
delay means wait. Nothing else happens while it waits.
In this project
It keeps the light on (or off) long enough for us to see.
Why here
Right after we turn the light on or off.
delay(500);