Lesson 4
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.
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.
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.

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

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.
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.
Before uploading, the IDE needs to know which board you are using and which port it is connected to. In the Tools menu:
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.

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.
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
delay(1000);
}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.
Exercise
delayinstructions (for example, use 200 instead of 1000), upload the program again, and observe the difference.