Arduino is an open-source prototype platform that allows users to easily create electronic devices and control them using code. In this tutorial, we will walk you through the steps to get started with Arduino.
To get started with Arduino, you will need the following materials:
The Arduino IDE is a free software that allows you to write and upload code to your Arduino board.
Follow the installation instructions below to install the software on your computer.
1. Download the latest version of the Arduino IDE from the official website:Download Arduino IDE web page
Select suitable download option:
2. When file is downloaded, locate it in your Downloads folder and execute it:
3. Click “I agree” button, to confirm the terms of agreement:
4. Choose install location and click “Install” button:
5. Wait for installation to finish:
6. Click “Finish” button to complete the installation and launch the ArduinoIDE software:
7. You are ready to use ArduinoIDE:
Connect your Arduino board to your computer using the USB cable. The USB port is usually located on the side or back of the board. Once you have connected the board to your computer, it should power up automatically.
Under “Select board” drop down menu select your board. You should be able to see the name of your Arduino board as also COM port to which it is connected to. For this example, we use Arduino UNO board. If you would use any other Arduino board, you can find it in the list of Arduino devices.
To write your first program, go to File > Examples > Basics > Blink. This will open a new window with the code for the Blink sketch. This sketch will make an LED blink on and off.
Click File/Save and save the sketch as “Arduino_blinky”.
We will modify the existing blinky example code so that we will delete the commented text and change the delay function values in the main loop. So let's change the time period of blinking from 1s to 100ms:
// the setup function runs once when you press reset or power the board void setup() { // initialize digital pin LED_BUILTIN as an output. pinMode(LED_BUILTIN, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) delay(100); // wait for 100 milliseconds digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW delay(100); // wait for 100 milliseconds }
So, the code in our .ino file now looks like this:
Now you can upload it to your Arduino board. To do this, click on the “Upload” button in the IDE. The IDE will compile your code and upload it to the board. You should see a message in the IDE indicating that the upload was successful.
Now that your program has been uploaded to the board, you can test it by observing the LED on the board. The LED should start blinking on and off.
Congratulations! You have successfully written and uploaded your first program to an Arduino board. From here, you can continue to experiment and create more complex programs using the Arduino IDE and your Arduino board.