Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void read_adc_0(uint8_t *high, uint8_t *low)
- {
- ADCSRA |= (1<<ADEN)|(1<<ADPS2)|(1<<ADPS1);
- _delay_ms(10);
- ADCSRA |= (1<<ADSC);//start conversion
- while((ADCSRA & (1<<ADSC)));//Wait for conversion to complete
- *high = ADCL;
- *low = ADCH;
- ADCSRA &= ~(1<<ADEN);//turn off the ADC
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement