#include <avr/io.h>
#include <avr/interrupt.h>
void initimer1(void)
{
cli(); // gdisable globale interrupt
TCCR1A=0; // set entire TCCR1A to 0
TCCR1B=0; // same for TCCR1B
// set compare match register to desired time count:
TCNT1=0;
OCR1A=15;
TCCR1B = (1 << WGM12);// turn on CTC mode:
// Set CS10 bits for 1 prescaler:
TCCR1B |=(1<<CS10);
TCCR1A|=(1<<COM1A0);
}
void setup() {
// initialize Timer1
initimer1();
// OUTPUT PIN PB1
DDRB|=(1<<1);
}
void loop()
{
}