- 2
- 0
- 约1.05千字
- 约 3页
- 2023-05-14 发布于上海
- 举报
/*************** writer:shopping.w ******************/ #include reg52.h
#define uint unsigned int #define uchar unsigned char sbit LED1 = P1^0;
sbit LED2 = P1^3; sbit K1 = P1^7;
uchar Operation_NO = 0; uchar code DSY_CODE[]=
{
0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f
};
void Delay(uint x)
{
uchar i; while(x--)
{
for(i=0;i120;i++);
}
}
void putc_to_SerialPort(uchar c)
{
SBUF = c;
while(TI == 0);
TI = 0;
}
void main()
{
LED1=LED2=1; P0 = 0x00; SCON = 0x50;
TMOD = 0x20; PCON = 0x00;
TH1 = 0xfd; TL1 = 0xfd; TI = 0;
RI = 0;
TR1 = 1;
IE = 0x90;
while(1)
{
//工作模式 2,允许接收
//开总中断,串行中断
Del
原创力文档

文档评论(0)