//该程序实现了
#include <reg51.h>
#define display_data P0
sbit display_bit=P2^2;
int i;
unsigned char receive_data;
unsigned char tab[]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,0xFF};
void display(unsigned char data1)
{
display_bit=0;
display_data=tab[data1];
}
void serial() interrupt 4
{
RI="0";
receive_data=SBUF;
}
void main()
{
i="0";
P0=0x01;
SCON="0x50";
PCON="0x80";
TMOD="0x20";
TL1=0xf4;
TH1=0xf4;
EA="1";
ES="1";
TR1=1;
while(1)
{
display(receive_data);
}
}
文章评论(0条评论)
登录后参与讨论