Module 1 - Getting Started

03. Arduino IDE 2 & First Upload

Install Arduino IDE 2, select board and port, Verify, Upload, and blink the onboard LED.

Estimated time 2 hoursIn class Week 1 · Session 2

Learning outcomes

  • Install and navigate Arduino IDE 2
  • Select the correct board definition and serial port
  • Explain the difference between Verify (compile) and Upload
  • Run the Blink sketch on LED_BUILTIN and diagnose common upload faults
  • Know when Library Manager is needed for later lessons

Parts and preparation

Arduino Uno, USB data cable and Arduino IDE 2 (desktop). No breadboard required for Blink.

Before power: inspect wiring, confirm supply voltage and ensure all connected circuits share GND.

Arduino IDE 2 & First Upload instructional connection diagram

Your first reliable workflow

Arduino IDE 2 is where you write sketches, compile them, and send them to the board. A repeatable habit prevents most beginner frustration: correct board, correct port, Verify until clean, then Upload, then observe.

Write, Verify, Upload, Observe workflow
Write -> Verify -> Upload -> Observe. Fix the first error before hunting later ones.

Verify vs Upload

Verify (tick icon) compiles your C++ sketch on the computer and reports syntax or type errors. It does not change what is running on the Uno.

Upload compiles (if needed) and transfers the binary through the selected port. The board resets and then runs the new program from setup() into loop().

Verify compiles only; Upload compiles and transfers to the board
Verify fixes code errors. Upload needs board + port and updates the flash.

Board and port

Tools -> Board selects the hardware definition (Arduino Uno for classic R3, or UNO R4 Minima if that is your board). Wrong board choice causes confusing compile or upload failures.

Tools -> Port selects which USB device receives the upload. The port usually appears only when a data cable is connected. Charge-only cables look plugged in but never enumerate a port.

Which port is the Uno? Open the Port list, unplug the Uno, and look again - the port that disappeared is yours. On Windows it looks like COM3 or COM5.

Board selects hardware definition; Port selects the USB device
Both Board and Port must match the hardware on your desk.

Clone boards and the CH340 driver

Many lab Unos are clones. Instead of the official USB chip they use a CH340 USB-to-serial chip, so still choose Tools -> Board -> Arduino Uno. On most Windows PCs the CH340 driver installs by itself the first time you plug in.

If no port appears with a known data cable, open Device Manager and look under Ports (COM & LPT) for USB-SERIAL CH340 (COMx). If it is missing or shows a warning icon, the driver is not installed - ask your facilitator, or install the CH340 driver from the chip maker (WCH) and plug in again.

Open the Serial Monitor

Sketches from the next lesson onwards print messages with Serial.println. To read them, click the magnifying-glass icon at the top right of the IDE (or Tools -> Serial Monitor). A panel opens under your code.

Set the baud rate drop-down in that panel to 9600, the same number as Serial.begin(9600) in the sketch. A wrong baud rate shows rubbish characters or nothing. If an upload fails with port busy, close the Serial Monitor and upload again.

The classic first sketch blinks the onboard L LED. LED_BUILTIN is a named constant for that pin (usually 13 on Uno). The board already includes a series resistor for L - no breadboard required.

setup() runs once after reset and configures the pin. loop() turns the LED on, waits, turns it off, waits, and repeats.

LED_BUILTIN maps to the onboard L LED near pin 13
Watch the L LED after a successful Upload.
void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  digitalWrite(LED_BUILTIN, HIGH);
  delay(1000);
  digitalWrite(LED_BUILTIN, LOW);
  delay(1000);
}

Reading error messages

Always read the first compiler error - later messages are often knock-on effects. Missing semicolons are often reported on the next line. Case matters: setup, pinMode, HIGH and LOW must match exactly.

Upload errors such as not in sync or port busy: close Serial Monitor and other programs using the port, recheck Board/Port, try another USB socket or data cable, then retry.

SymptomLikely fix
No port listedData cable; reconnect; CH340 driver on clone boards; another USB socket
Serial Monitor shows rubbishSet the Monitor baud to match Serial.begin (9600)
Wrong boardTools -> Board -> Arduino Uno (or R4 Minima)
Compile errorRead first error; check ; and spelling
Upload not in syncClose Monitor; correct port; retry

Library Manager (preview)

Later lessons install third-party libraries with Tools -> Manage Libraries. Each of those lessons names the exact Library Manager title and author. Install only that package - similarly named libraries often use different APIs.

Blink itself needs no extra library.

Wiring and safe build sequence

  1. Connect Uno to the PC with a USB data cable
  2. Tools -> Board -> Arduino Uno (or UNO R4 Minima if that is your board)
  3. Tools -> Port -> choose the port that appears when the Uno is connected
  4. Open File -> Examples -> 01.Basics -> Blink (or paste the worked sketch)
  5. Click Verify, then Upload; watch the onboard L LED
Power rule: switch off before moving wires. Arduino I/O pins are control signals; high-current loads require a driver and suitable external supply.
void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  digitalWrite(LED_BUILTIN, HIGH);  // LED on
  delay(1000);
  digitalWrite(LED_BUILTIN, LOW);   // LED off
  delay(1000);
}

How the code works

  1. LED_BUILTIN maps to the board onboard LED pin (usually 13).
  2. setup runs once after reset; loop repeats for as long as the board is powered.
  3. delay(1000) waits one second - fine for Blink; later lessons introduce millis for multi-task timing.
  4. No breadboard is required for this first upload.

Test and record evidence

Expected result: After Upload, the onboard L LED is on for about one second and off for about one second, repeating.

Practical evidence checklist

Common faults and checks
  • Port not found: reconnect with a known data cable; try another USB port.
  • Not in sync: verify Uno and port selections, close other serial programs, retry.
  • Compilation error: read the first error, not only the final summary.
  • Upload OK but no blink: confirm you uploaded Blink (not an empty sketch) and look at the L LED near pin 13.
Extension challenge: Change the sketch to produce two short flashes (200 ms on) followed by a one-second pause, then repeat.

Check your understanding

Q1. What does Verify do?

Show answer

Compiles the sketch and reports errors without uploading.

Q2. What is the difference between board and port selection?

Show answer

Board selects the target hardware definition; port selects the connected USB device.

Q3. What does LED_BUILTIN refer to?

Show answer

The pin connected to the board onboard LED (usually pin 13 on Uno).

Q4. Name one common cause of a missing port.

Show answer

A charge-only USB cable, missing drivers, or the board not connected.

Q5. Why read the first compiler error first?

Show answer

Later errors are often knock-on effects of the first mistake.