#include <avr/io.h>
#include <avr/interrupt.h>
#ifndef _BV
#define _BV(x) (1 << x)
#endif
#define F_CPU 16000000
bool led;
ISR(TIMER1_COMPA_vect){
TCNT1 = 0;
led = !led;
}
int main(void){
DDRD |= _BV(6);
cli();
TCCR1A = 0;
TCCR1B = 0;
TCCR1B |= 4;
TIMSK1 |= 2;
OCR1A = 62500;
sei();
while(1){
if(led){
PORTD |= _BV(6);
} else {
PORTD &= ~_BV(6);
}
}
return 0;
}