Posted on 42 Comments

How to Program an Arduino

Do you own Arduino and looking to program it as per your need? You have landed to the right article.

Here in this article, we will learn how to program the Arduino board. There are many types of Arduino available, but Arduino Uno is most common. So when you are planning to build something for your project, make sure you do a bit of research on the features and versions.

Step 1

The first step to start programming Arduino is to install the Arduino programmer, which is also known as IDE. You can install Arduino programmer on Windows, Linux or MAC machine

Step 2

Now go ahead and connect your Arduino board to the USB port of your PC. You might need to have a specific cable. Make sure you’ve reconfigured the serial-port address as every Arduino posses unique serial-port.

Step 3

Select the type of board and the serial in the Arduino programmer software.

Step 4

Before beginning with your hardcore coding, make sure you do a test using the preloaded programs that are called sketches. You will find these within the Arduino programmer software itself. To test it, just select the sketches and press the “Upload” button. You will find that the Arduino board has started responding to the code and if you have uploaded the program to blink LED light, it will start blinking.

Step 5

There are only two ways to upload the code to Arduino, one is by writing your code or you can copy and paste from anywhere else. Arduino sketch has five parts.

  1. Header: it describes the sketch and its author
  2. Section: that defines the variables
  3. Setup Routine: used to set up the Arduino so that you can run preliminary code
  4. Loop Routine: This is used when you upload code and execute it repeatedly until the sketch is stopped
  5. Other Section: This is the section that can be used to mention other functions that get activated during the setup loop routines

To upload the code, click on the “Upload” button and your Arduino board is ready to use. Now you can disconnect it from the PC and start using it in your project.

Here is a simple code to blink LED light