Arduino Programming: What is Arduino and How to Program it?
What is Arduino?
An Arduino is an open source hardware platform with built in programming support. No additional hardware or software (e.g. Hex burner) is required to transfer your programs (i.e. hex file) to the Arduin0. There are all the necessary peripherals attached for the basic operation. It is based on simple AVR microcontrollers.
Arduino is a growing industry nowadays and the major reason behind it is the vast majority of libraries. Users don’t have to invent the wheel again. Long traditional codes have been reduced to few lines now. it is easy to use and enhance productivity. Arduino can be used to make a variety of projects taking analogue as well as digital inputs and can easily interface with different hardware like switches, encoders, Sensors, Motors, relays and many more.
Arduino board PCB designs and schematics are freely available on internet community and blogs and it can also be purchased from the respective sellers and its Integrated Development Environment is free to download, different versions of this IDE are available to make it compatible with different OS (Operating systems) like Mac, windows, etc.
1) Arduino has it’s built in programmer to burn the Hex file in it, for most of the beginners, it is very irritating to buy Microcontroller and Burner separately and sometimes it is very annoying , when poor hardware has a little hidden broken wire and you will waste plenty of precious hours.
2) Its open source so the whole word developer constantly working on its upgrade and fixing its bugs, so its support is readily available worldwide.
3) The largest number of libraries is freely available so person does not need to write a lot of basic code to make the things run.
4) Arduino support many different shields, which can be attached to the basic Arduino board with male to female Headers. It reduces the traditional wiring and chances of errors are less. It is also space and power efficient.
These all the above features are generally not available with single stand-alone microcontroller. That’s why Arduino is loved by the hobbyist as well as professionals.
Flash Memory 32 KB (ATmega328) ( 0.5 KB used by boot-loader)
Clock Speed (Ceramic Resonator) 16 MHz
SRAM (Memory) 2 KB (ATmega328 MCU)
EEPROM (Memory) 1 KB (ATmega328 MCU)
Now start with Arduino First basic program.
Download the Arduino IDE from www.arduino.cc, install it and then double click on the software icon to run.Basics Arduino Programming :
Arduino coding has two major blocks. One of them is called void setup and the other one is void loop. In void setup, we define that which pin should be input and output. It is used to initialize variables and start using libraries.
Second block of the code is void loop. It contains all the code and logics placed within the brackets (it will repeat endlessly).
Let’s write this bare minimum code:
Do not forget to select the appropriate board. Once the board is selected now start writing the code for this specific board.
A few basic functions of Arduino Programming to remember:
This syntax is used while assigning a specific name to the pins of ardunio.
Int LED = 13;
Here 13 is the pin number and LED is the new name of that pin now we can access the same pin with both names .
We want to write the code to blink the led. PinMode (X, Y) function: this function takes 2 arguments
1) Pin name or number (X)
2) Defines as output or input (y)
The above statement defines Led as output.
This function Write Digital 1 or 0 to the pin defined in the arguments of this function. This function also takes 2 arguments
Pin number or name
Whether writing “Low” or “High”
The above statement will write +5 volts on the pin named LED.
This is a built in function of Arduino IDE. It has only one argument i.e. it gives delay in milliseconds.
Then this function will give us delay of 1000 milliseconds.
Final LED Program: Now click on the button (as shown in the above image) to load the program to the Arduino board. you have done 🙂
Stay tune for more updates tutorials like this one.
Enter your Email for Latest Updates like the above one!