Created
August 24, 2016 06:51
-
-
Save prasant1010/1d2fa7c3ffa4abf7b18ca93c6ee131fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unsigned int ADC_read(unsigned int x) | |
{ | |
ADMUX|=x; //selecting cannel | |
ADCSRA|=(1<<ADSC); // start conversion | |
while(!(ADCSRA & (1<<ADIF))); // waiting for ADIF, conversion complete | |
ADCSRA|=(1<<ADIF); // clearing of ADIF, it is done by writing 1 to it | |
return (ADC); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment