#include <reg51.h>
#include <stdio.h>
#define uint unsigned int
#define uchar unsigned char
sbit p36=P3^6;
uchar code cc[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
uchar code addr[]={0x0f0,0x0f1,0x0f2,0x0f3};
void delay (uint i)
{while(i--)
;
}
void main(void)
{
uchar vv[4];
p36=1;
vv[0]=4;
vv[1]=6;
vv[2]=7;
vv[3]=3;
while (1)
{
uchar i;
i=4;
while(i--)
{
P2=addr[3-i];
P0=cc[vv[3-i]];
if (i==1)
{
P0=cc[vv[3-i]] | 0x80;
}
p36=0;
delay(50);
p36=1;
}
}
}