#include "SH79F166A.h"
#define uchar unsigned char
#define unit unsigned int
#define fosc12
uchar code TAB[10]={ //
0xC0,0xF9,0xA4,0xB0,0x99, //0-4
0x92,0x82,0xF8,0x80,0x90, //5-9
};
void delay_ms(uchar ms)
{
uchar i,j;
for(i=0;i<ms;i++)
{
for(j=0;j<164;j++);
for(j=0;j<164;j++);
}
}
void display()
{
P1=TAB[1];
P3_7= 0;
delay_ms(1);
P3_7=1;
P1=TAB[2];
P3_6=0;
delay_ms(1);
P3_6=1;
P1=TAB[3];
P3_5=0;
delay_ms(1);
P3_5=1;
P1=TAB[4];
P3_4=0;
delay_ms(1);
P3_4=1;
P1=TAB[5];
P3_3=0;
delay_ms(1);
P3_3=1;
P1=TAB[6];
P3_2=0;
delay_ms(1);
P3_2=1;
P1=TAB[7];
P3_1=0;
delay_ms(1);
P3_1=1;
P1=TAB[8];
P3_0=0;
delay_ms(1);
P3_0=1;
}
main()
{
P3SS=0x00;
P1SS=0x00;
P1CR=0xFF;
P3CR=0xFF;
P1=0xFF;
P3=0xFF;
while(1)
{
display();
}
}