Write your first program.
"Hello World!"
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.
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.
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!");
}
Make sure Arduino UNO is selected as the board and the port that shows USB is selected.
First click the check mark (verify) button, and then the arrow (upload) button.
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.
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.
avrdude: ser_open(): can't open device "\\.\COM3": The system cannot find the file specified.avrdude: stk500_recv(): programmer is not respondingTo fix this, download and install the CH341 driver. After installation, reconnect your board and restart the Arduino IDE.
Download CH341 DriverNote: Windows may show a security warning. This is normal; the driver is safe.