ADC is used by most of the sensors for eg- temperature sensor, force sensor, IR sensor, potentiometer, and many more. All these sensors send the data to the microcontroller in analogue form, which then converts it into digital values.
The process is very straight forward, you have to measure the number of times input pin goes high and low in 1 second. This measure will give you the frequency.
1.) Set a pin as input and make sure you connect a pull-up register to it. Pull-up is necessary otherwise pin will not go to high state.
2.) Give in the frequency input to the pin and display the frequency on the serial terminal via UART.
VEE pin is connected to variable resistor for contrast adjustment.
RS pin is Register select and used to select data or command mode. RS=0 is command and RS=1 is DATA.
R/W pin is to read or write from LCD. select 1 to write, 0 to read.
EN pin is Enable.
Timing is very important part of a microcontroller programming. We certainly can not depend on delay functions because no matter how precise they are, they are not accurate. For eg- DHT11, a temperature sensor, works only if we give it specific pulses for specific amount of time(in microseconds and milliseconds).We will learn about it later in the blog. But for now we will use timer for controlling blinking of LED with different time interval.