Arduino Simple Project Programming Step by step Approach

Arduino Programming Guide  – Step by Step procedure

We had already seen How to install arduino IDE in our PC in our previous post. Once installed we shall start to learn how to program in arduino…

In this post we are going to do the following stuffs:

  1. Execute the basic example program (LED Blink project) using in-built board LED
  2. Execute the same LED blink program using external LED
  3. Understand and Customize the LED blink  program

Execute Basic Example Program (LED Blink project) using in-built board LED

  1. Power the Arduino board by connecting  USB pin.
  2. Open the Arduino IDE exe.
  3. Goto File –> Examples –> 01.Basics –> Blink
  4. New window showing the Blink LED program code will appear as shown in the below figure
    LED_Blink_1
  5. This is arduino coding. They are called as sketches.
  6. Now click the upload button ( Horizontal arrow).
  7. Once the code is uploaded successfully , the Red LED in the board will start to blink.
  8. Congratulations you have done your first Arduino based project. ( Remember that every marathon run will start from a step)…

Execute LED blink program using external LED

  1. Connect the thru hole 5mm LED to the Arduino board as follows;
    Anode to the Digital pin no -13 ( you can identify the pin which will be near to the push button)
    Cathode to the GND  ( which is next to pin – no -13)
  2. Power the Arduino Board by connecting the USB pin.
  3. Now the external LED will blink similar to the in-build LED.

Understand and Customize the LED blink  program

Now we will modify the existing code as we like.

  • The arduino codes are known as sketches.
  • The sketches are written in C++ Programming language.
  • Remember that you no need to be expert in C++ language to do the arduino based projects.
  • Set of predefined standard functions will help you to write the sketches.

If you go through the program you will understand the flow of program with the help of comments.

The words typed after two forward slash [ // ]  are comments. They will not impact anything in the program execution.

For all the sketches the setup() function is compulsory.

The loop function  will run indefinitely the instructions given within the parenthesis.

The instructions are self-explanatory.

The following instructions will give 5V and 0V  to the pin no-13.

Remember that the arduino codes are case-sensitive. So instead of

if we type  (m is not in capital letter),

the program will not run. See the screen shot below:
LED_Blink_2
We can change pin in which the anode of the LED has to be connected.

If we want to connect the anode to pin no 12, then we have to modify the program as follows:

Similarly we can use any one of the pin, out of 13 pins in the arduino board.(The code will change accordingly)

We can change the LED blinking time by changing the last line of the code into

and upload( click the horizontal arrow button) the code again. Now the LED will be ON for short time(1 second) and OFF for long time (5 second).

We believe that this excercise will give much confidence to you to do more with Arduino Board…

Read More:

Final Year Applet Project Free Download
555 Timer Projects for Beginners – 555 Timer Delay Circuit Design
Simple LED Flasher Circuit

Thanks for reading… Please leave your comments below….

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *