Unit A - Foundations

03. Arduino IDE 2 & First Upload

Install, verify, upload and diagnose the Blink sketch.

Estimated time 2 hours

Learning outcomes

  • Install and navigate Arduino IDE 2
  • Select the Uno board and correct port
  • Explain verify, compile and upload
  • Use compiler and upload messages to diagnose faults

Parts and preparation

Arduino Uno, USB data cable and Arduino IDE 2.

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

Arduino IDE 2 & First Upload instructional connection diagram
Open the diagram for a larger view. Trace every connection before building.

From sketch to machine code

Verify compiles C++ source and reports syntax/type errors. Upload compiles and transfers the binary program through the selected port. Reset starts the program from the beginning.

Board and port

The board choice selects the correct core and upload method. The port identifies the connected board. A missing port often means a cable, driver or permission problem.

Library Manager

Use Tools -> Manage Libraries to install third-party libraries. Each lesson that needs a library has a Libraries box with the exact Library Manager name and author. Install only that package, because similarly named libraries often use different APIs.

Wiring and safe build sequence

  1. Connect Uno by USB
  2. Tools -> Board -> Arduino Uno
  3. Tools -> Port -> choose the port that appears when the Uno is connected
  4. File -> Examples -> 01.Basics -> Blink
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);
  delay(1000);
  digitalWrite(LED_BUILTIN, LOW);
  delay(1000);
}

How the code works

  1. LED_BUILTIN maps to the boards onboard LED pin.
  2. setup runs once after reset; loop repeats indefinitely.

Test and record evidence

Expected result: The onboard L LED is on for one second and off for one second.

Practical evidence checklist

Common faults and checks
  • Port not found: reconnect with a known data cable.
  • Not in sync: verify Uno and port selections, close other serial programs and retry.
  • Compilation error: read the first error, not only the final summary.
Extension challenge: Change the sketch to produce two short flashes followed by a one-second pause.

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 device.