#include <avr/io.h>

// Last modified: 26 October 2006
// Changed to work with WinAVR 20060421
// modified: 21 April 2005


// Compiled on WinAVR 20060421

//---------------------
// function prototypes
void delay(void);
int main(void);
//---------------------



void delay(void)
{
uint32_t waitcounter;
	waitcounter = 10000000;	
	while(0 != waitcounter) {
		waitcounter--;
	}	
}

int main(void)
{
uint32_t ctr;
//---------
// initialise the hardware
	DDRB = 0x1F;

//---------
// the main loop
	while(1) {
		for (ctr=0; ctr<8; ctr++){
// set color
			PORTB = ctr*4;
// turn on LED
			PORTB |= 0x01;
// the delay
			delay();
// turn off LED
			PORTB &= 0xFE;
		}
	}
//---------

}
