#define F_CPU 4000000UL
#include<avr/io.h>
#include<util/delay.h>
#define uchar8 unsigned char
#define uint16 unsigned int
const uchar8 seg_code[]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,0x88,0x83,0xC6,0xA1,0x86,0x8E};
//0 1 2 3 4 5 6 7 8 9 a b c d e f
int main()
{
uchar8 i;
DDRC=0xff;
DDRD=0xff;
while(1)
{
for(i=0;i<8;i++)
{
PORTC=0xff;
PORTD=_BV(i);
PORTC=seg_code[i];
_delay_ms(6);
}
}
}