Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
#include "adc.h"
void adc_Init(void) {
// select AVCC as reference
ADMUX = (1 << REFS0);
// ADC enable, prescaler=64 -> 125kHz
ADCSRA |= (1 << ADEN) | (1 << ADPS2)
| (1 << ADPS1);
adc.currentChannel = 0;
// start conversions
ADCSRA |= (1 << ADSC);
}
a1e44dabdThis file is pinned to the selected release. Download the original to open it in your design tool.