Lesson 4 / 1233%

Lesson 4

Installing the Arduino IDE

20 min

Download the software, plug in the board and upload a first example.

Definition

An IDE ("Integrated Development Environment") is software that brings together everything needed for programming in one place: an editor for writing code, a compiler for translating it into machine language, and tools for uploading it to the board and monitoring its operation. The Arduino IDE is the official IDE for Arduino boards.

Why Do You Need Special Software?

Your board cannot understand the text you write. It only understands instructions in machine language, a sequence of binary numbers. The Arduino IDE handles this translation, which is calledcompilation. It then sends the result to the board through the USB cable: this is called uploading. You write your program in a readable language, and the software takes care of the rest.

Downloading the Arduino IDE

The official software for programming Arduino boards is called the Arduino IDE. It is free and available for Windows, macOS, and Linux on thearduino.ccwebsite, under the "Software" section. Download the version that matches your operating system and install it like any other application.

Always download the software from the official website, never from a third-party website, to make sure you get an authentic and safe version. The website may offer the option to make a donation: this is optional, and you can simply choose to download the software.

Screenshot: the Arduino IDE download page on arduino.cc showing the Windows, macOS, and Linux options.

Installing the IDE on Your Operating System

  • Windows:run the downloaded installer and follow the steps. Accept the installation of drivers if prompted, as they allow your computer to recognize the board.
  • macOS:open the downloaded file and drag the Arduino IDE application into the "Applications" folder.
  • Linux:extract the downloaded archive and launch the application, or use your preferred format (such as AppImage). On some distributions, you may need to add your user account to the group that manages serial ports.

Exploring the Interface

When you launch the IDE for the first time, it opens a new program (called a sketch) containing two empty functions. Here are the main elements you should know:

  • The Verify button (checkmark): compiles the program to detect errors without uploading it to the board.
  • The Upload button (arrow): compiles the program and then uploads it to the board.
  • The code editor:the area where you write your code.
  • The console at the bottom: displays messages and compilation errors.
  • The Serial Monitor (magnifying glass icon in the upper-right corner): displays messages sent by the board.

The two empty functions in the initial sketch aresetup(), which runs only once when the board starts, andloop(), which runs continuously. Every Arduino program is built around these two blocks.

Screenshot: the Arduino IDE interface with each area labeled (Verify and Upload buttons, code editor, console, Serial Monitor).

Verify or Upload?

These two buttons are close to each other, but they have different purposes. The Verify button only checks whether your code is correct: the board does not need to be connected. The Upload button performs the same verification and then sends the program to the board, which must therefore be connected and correctly configured. Get into the habit of verifying your code regularly while writing it, as this helps you detect errors early.

Connecting the Board

Connect the board to your computer using the USB cable. A small green LED labeled ON should light up on the board, indicating that it is receiving power. The USB cable is used both to power the board and to upload your programs.

If the ON LED does not light up, try another USB port or a different cable. Also avoid connecting the board through an underpowered USB hub: connect it directly to your computer instead.

Selecting the Board and Port

Before uploading, the IDE needs to know which board you are using and which port it is connected to. In the Tools menu:

  • Board:select "Arduino Uno" (or your board's model).
  • Port:select the port that appears when the board is connected (COM followed by a number on Windows, a name containing "usbmodem" on macOS, or "ttyACM" or "ttyUSB" on Linux).

A port is simply the "channel" through which your computer communicates with the board. Here is a useful trick to find the correct one: open the Port menu while the board is disconnected and note the available entries. Then reconnect the board. The new entry that appears corresponds to your board. You may need to select it again if you switch to another USB port.

Screenshot: the IDE Tools menu with Arduino Uno selected as the board type and the correct port selected.

Testing with an Example

The IDE comes with ready-to-use examples. Open the File > Examples > 01.Basics > Blinkmenu, then click the Upload button. Once the program has been uploaded, the small LED labeled L on the board will start blinking, turning on and off every second.

Blink (simplified example included with the IDE)
void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
}

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

Understanding the Blink Program

You do not need to master everything right now, but here is what each instruction does. You will use them again in the following lessons:

  • pinMode(LED_BUILTIN, OUTPUT): sets the built-in LED pin as an output, meaning the board will control it.
  • digitalWrite(LED_BUILTIN, HIGH): sets the pin to HIGH, turning the LED on.
  • delay(1000): pauses the program for 1,000 milliseconds, which equals one second.
  • digitalWrite(LED_BUILTIN, LOW): sets the pin to LOW, turning the LED off.

Since loop()repeats indefinitely, the LED stays on for one second, turns off for one second, and continues this cycle as long as the board is powered.

If It Doesn't Work

No port appears? Try another USB cable (some cables are designed only for charging and cannot transfer data), another USB port on your computer, and check that the driver is installed. Compatible boards using the CH340 chip sometimes require an additional driver.

Common Problems

  • Wrong board selected:the upload fails with a synchronization error. Check the Tools > Board menu.
  • Wrong port:the IDE cannot communicate with the board. Try disconnecting and reconnecting the board to identify the correct port.
  • Port in use:if the Serial Monitor is open in another window, close it before uploading.
  • Compilation error:read the console at the bottom. It indicates the line involved, often because of a missing semicolon or curly brace.
  • Board not blinking:check that the "Done uploading" message appears in the console.

Key Takeaways

  • The Arduino IDE is free software used to write, compile, and upload programs.
  • The Verify button checks your code, while the Upload button sends it to the board.
  • You must select the correct board typeand port in the Tools menu.
  • The Blink program is the "Hello World" of electronics: it is used to test your installation.
  • If you encounter problems, start by trying a different USB cable and port.

Exercise

Install the Arduino IDE, connect your board, and upload the Blink example. Then change the values of bothdelayinstructions (for example, use 200 instead of 1000), upload the program again, and observe the difference.