完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
还得下载~
|
|
|
|
大神们别只看不回复啊,给个回复呗
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
直接贴出来看看
|
|
|
|
下载需要积分的
|
|
|
|
为何不把程序贴出来,下载还要1分的。
|
|
|
|
/*************** writer:shopping.w ******************/ #include #define uint unsigned int #define uchar unsigned char uchar Receive_Buffer[101]; uchar Buf_Index = 0; uchar code DSY_CODE[]= { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x00 }; void Delay(uint x) { uchar i; while(x--) { for(i=0;i<120;i++); } } void main() { uchar i; P0 = 0x00; Receive_Buffer[0]=i; SCON = 0x50; TMOD = 0x20; PCON = 0x00; TH1 = 0xfd; TL1 = 0xfd; EA = 1; EX0 = 1; IT0 = 1; ES = 1; IP = 0x01; TR1 = 1; while(1) { for(i=0;i<100;i++) { if(Receive_Buffer==-1) break; P0 = DSY_CODE[Receive_Buffer]; Delay(200); } Delay(200); } } void Serial_INT() interrupt 4 { uchar c; if(RI==0) return; ES = 0; RI = 0; c = SBUF; if(c>='0' && c<='9') { Receive_Buffer[Buf_Index]=c-'0'; Receive_Buffer[Buf_Index+1]=-1; Buf_Index = (Buf_Index+1)%100; } ES = 1; } void EX_INT0() interrupt 0 { uchar *s = ("Receiving From 8051...rn"); uchar i = 0; while(s!=' |