#ifndef ANALOG_READ_H #define ANALOG_READ_H /** analog read: * change ADMUX MUXn and REFS1:0 to select channel, * ADC enbale bit: ADEN in ADCSRA * ADC is data reg. Right ajusted, can be left by ADLAR in ADMUX * If left ajusted & no more then 8 bits, read ADCH, otherwise first ADCL * Conversion: * Set ADSC (is cleared once conversion is done) * Or: ADTS mux bits in ADCSRA for auto trigger (will trigger on high) * interrupt flag will be enabled **/ //PORTF pin 1 hardcoded as analog uint8_t analog_read_8bit(); void init_adc(); #endif