Task 3: Hello World!

Write your first program.

Writing your first program in the IDE.

"Hello World!"

Step 1: Set Up Your Arduino Board

Make sure you have an Arduino board (e.g., Arduino Uno) and a USB cable.

Connect one end of the USB cable to your Arduino board and the other end to your computer.

When your computer recognizes your Arduino board you will hear a notification sound.

...

Step 2: Launch Arduino IDE

Open the IDE on your computer. You can find it in your applications or programs menu.

2. The IDE will open with a blank sketch ready for you to write your code.

...

Step 3: Write the “Hello World” Code

In the Arduino IDE, you’ll see a text editor where you can write your code (do not delete void setup() or void loop() ).

Type the following code:


// Lesson 1: Hello World!

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  Serial.print("Hello World!");
}
      

Step 4: Upload

Make sure Arduino UNO is selected as the board and the port that shows USB is selected.

Arduino IDE interface showing the process of selecting the Arduino UNO board and the port marked with USB. The interface includes a search bar for boards and a list of ports. The environment is clean and technical, designed for ease of use.

First click the check mark (verify) button, and then the arrow (upload) button.

Arduino IDE interface showing the process of verifying and uploading the sketch to the Arduino UNO MCU. The interface includes buttons for verify (check mark) and upload (arrow), with a clean and technical environment designed for ease of use.

If this is the first time using the Arduino IDE and an Arduino board, you may get an error, if so follow the instructions below to install the CH341 driver.

CH341 Driver Required

If you are using an Arduino clone (e.g., Nano, Uno clone) and your board is not recognized by the Arduino IDE, it may be due to a missing CH341 USB-to-serial driver.

Common Error Messages:
  • avrdude: ser_open(): can't open device "\\.\COM3": The system cannot find the file specified.
  • avrdude: stk500_recv(): programmer is not responding
  • No serial port shows up in Tools → Port.

To fix this, download and install the CH341 driver. After installation, reconnect your board and restart the Arduino IDE.

Download CH341 Driver

Note: Windows may show a security warning. This is normal; the driver is safe.

Congratulations! You just wrote your first program!

Don't forget to save your sketch before you close the IDE.