《单片机的串口通信程序.pdf》由会员分享,可在线阅读,更多相关《单片机的串口通信程序.pdf(5页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、单片机串口通信程序 include include include include define uchar unsigned char define uint unsigned int sbit Key1=P23;sbit Key2=P22;sbit Key3=P21;sbit Key4=P20;sbit BELL=P36;sbit CONNECT=P37;unsigned int Key1_flag=0;unsigned int Key2_flag=0;unsigned int Key3_flag=0;unsigned int Key4_flag=0;unsigned char b;uns
2、igned char code Num21=0 xc0,0 xf9,0 xa4,0 xb0,0 x99,0 x92,0 x82,0 xf8,0 x80,0 x90,0 x40,0 x79,0 x24,0 x30,0 x19,0 x12,0 x02,0 x78,0 x00,0 x10,0 x89;unsigned char code Disdigit4=0 x7F,0 xBF,0 xDF,0 xEF;unsigned char Disbuf4;void delaymsuint t uint i;whilet-/对于时钟,约延时 1ms/for i=0;i4;Disbuf3=SBUF&0 x0f;RI=0;else;