5. Setup: void setup() :
This is a declaration for a function called “setup”. This exact line is required in every Arduino sketch. It will only run once when the Arduino is powered or tends to reset.
6. Loop: void loop() { } :
This is where the bulk of your Arduino sketch is executed.The program starts directly after the opening curly bracket ({), runs until it sees the closing curly bracket (}), and jumps back up to the first line in loop() and starts all over.The loop() function will run over-and-over-and-over until the Arduino is reset.
7. Pin mode :
It is used to configure the specified pin to behave as an input or as an output, the pin mode is written in setup function so, it’s run once while the program executes.
Syntax: – pinMode (LED, OUTPUT);
8. Digital write:
Digital Write is used to provide the Digital value (HIGH as 5V or LOW as 0V), for those pins which are configured as an OUTPUT with pinMode ().
Syntax: – dgitalWrite (pin, value);
9. Digital Read:
Digital Read is use to read the value (Either HIGH or LOW), for specified digital pin.
Syntax: – digitalRead (pin);
10. Analog write:
AnalogWrite() function is used for varying the brightness of LED or drive the various speed of motor. It writes an analog value (PWM wave) to a pin.
Syntax: – analogWrite (pin, value);
11. Analog read:
Arduino Board contain a multichannel, 10-bit analog to digital converter.so it can map the input voltage into integer value between ‘0’ unit as zero voltage and 1023 unit as the maximum five voltage, it can be calculated as (5volt / 1024 = 0.0049 volts ‘4.9 mV’).
Syntax: – analogread (pin);