{
if (ACSR & (1 << ACO)) {
PORTB |= (1 << PB4);
+ ACSR &= ~(1 << ACIE);
} else {
PORTB &= ~(1 << PB4);
}
static void switch_idle(void)
{
- sei();
set_sleep_mode(SLEEP_MODE_IDLE);
sleep_mode();
}
//ADMUX |= (1 << MUX0); /* ADC1 as negative input */
ACSR &= ~(1 << ACD); /* enable comparator */
- //ACSR |= (1 << ACBG);
+ ACSR |= (1 << ACBG);
//ACSR |= (1 << ACIS1) | (1 << ACIS0);
DIDR0 |= (1 << AIN1D) | (1 << AIN0D);
//set_ref_voltage();
config_comparator();
sei();
+ switch_idle();
while(1) {
_delay_ms(100);