#define F_CPU 16000000UL
#include <Arduino.h>
#include <avr/io.h>
#include <util/delay.h>
#ifdef __cplusplus
extern "C" {
#endif
void mains();
#ifdef __cplusplus
}
#endif
void T05Delay(void)
{
TCNT1 = 0; // TCNT1= for delay of 0.5 seconds
TCCR1B |= (1<<CS10) | (1<<CS12); // Scale down the timer frequency to 8MHz/256
while ((TIFR1 & (1<<TOV1))==0); // wait for TF1 to roll over
TCCR1B = 0; // Stop Timer
TIFR1 = 1;
}
void setup(void) {
DDRB = 0XFF;
PORTB = 0x00;
while (1) { T05Delay(); PORTB = ~PORTB; };
}
void loop(void) {
}