#include <avr/io.h>
#include <util/delay.h>
#include <stdint.h>

int main()
{
    DDRD = 0xff;
    int a;
    
    while(1)
    {
    for(a=0x80;a>0;a=a>>1)
    {
     PORTD=~a;
     _delay_ms( 500 );
    }
    for(a=0x02;a<=0x80;a=a<<1)
    {
     PORTD=~a;
     _delay_ms( 500 );
    }
    }
}
