Тема: atmega16 ADC
int u;
void setup() {
Serial.begin(9600);
ADMUX |= (1<<MUX0)|(1<<REFS0);// ADC1 (PA1) PIN 36 input
ADCSRA |= (1<<ADEN) | (1<<ADSC) | (1<<ADATE);
ADCSRA |= (1<<ADPS2) | (1<<ADPS1) | (1<<ADPS0);// Division Factor 128
}
void loop() {
while((ADCSRA & (1 << ADIF)) == 0);
u = (ADCL|ADCH << 8);
Serial.println(u);
delay(500);
}