Showing posts with label Sample code for Input function of arduino. Show all posts
Arduino for Biginners
By : Asad Ali ArshadIntroduction
The foundation knowledge about the arduino includes it's principle and technique which are behind it's platform. If you want to know the basic knowledge about the arduino than it's a right place for you.Arduino is a open source electronic platform which is based on the easy to use software and hardware it's inputs are may be a light signal. a finger touch or just a twitter message which can convert this input into a output and can run a motor, turn a LED on and much more.
Pins of Arduino
The pins of arduino can be configure as input pins or output pins. These pins are also called as digital pins.Most of the analog inputs pin can also be used as digital input pins.
Analog pins 0 = Digital pin 14
Analog pin 5 = Digital pin 19
Digital pins are very easy to understand as there are only two state for it either ON or OFF.
In arduino sketch term the ON state is known as HIGH (5V) and the OFF state is known as Low (0V).
We can use these digital pins either as input or output totally depends upon on our choice by simply using the function pinMode() to configure the pins either INPUT pin or OUTPUT pin.
If you don't specify any mode than by default it is INPUT mode.
sample code for pin to be use as output pin.
pinMode(12, OUTPUT) // Set the digital pin 12 as OUTPUT pin
and for input pin
pinMode(14, INPUT) // Set the digital pin 14 as INPUT pin
Hitec Mechanical Engineering
Mechanical Engineeirng Hitec Mechanical Engineering As we know Mechanical Engineering is the branch of engineering dealing with the des...