#include <avr/io.h>
#include <avr/interrupt.h>

int out = 0x01;

ISR(TIMER0_OVF_vect)
{
	// user code here
	out <<= 1;
	if( out > 0xFF )
		out = 0x01;

	PORTB = out;

}

int main( int argc, char** argv ){

	TIMSK = 0x02;
	TCNT0 = 0xFF - 0x04;
	TCCR0B = 0x05; // 1/1024 mode

	DDRB = 0xFF;
	PORTB = out;

	sei();

	while( 1 );

	return 0;

}

