#include "reg51.h"
char c=20;
int table[10]={0x01,0x4f,0x12,0x06,0x4c,0x24,0x20,0x0f,0x00,0x04};
void delay(char);
bit P1_0 =0x90;
main()
{
char i;
IE=0x83;
IP=0x02;
TMOD=0x01;
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
TR0=1;
P1_0=1;
while(1)
{
for(i=0;i<10;i++)
{
P2=table[i];
delay(30);
}
}
}
void delay(char a)
{
int i,j;
for(i=0;i<a;i++)
for(j=0;j<1500;j++);
}
void t(void) interrupt 1
{
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
if(--c==0)
{
c=10;
P1^=0x01;
}
}
void y(void) interrupt 0
{
int r,i=0x80;
for(r=0;r<8;r++)
{
P0=~i;
i>>=1;
delay(30);
}
}