how does adc work in microcontroller?
An Analog to Digital Converter (ADC) is a very useful feature that converts an analog voltage on a pin to a digital number. ... The microcontroller monitors the number of clock cycles that pass before the capacitor is discharged. This number of cycles is the number that is returned once the ADC is complete.