#include<avr/io.h>
#define LED PD4
int main()
{
int timerOverflowCount=0;
DDRF = 0xff; //configure PORTD as output
TCNT0 = 0x00;
TCCR0B = (1<<CS00) | (1<<CS02);
while(1)
{
while ((TIFR0 & 0x01) == 0);
TCNT0 = 0x00;
TIFR0=0x01; //clear timer1 overflow flag
timerOverflowCount++;
if (timerOverflowCount>=6) //(approx. 100 mili second delay)
{
PORTF ^= 0xFF ; // ( portf XOR with FF to toggle between On and OFF)
timerOverflowCount=0;
}
}
}