标题: 单片机串口通信 [打印本页]

作者: 小马锅    时间: 2017-12-18 13:36
标题: 单片机串口通信
利用串口通信,实现单片机的多级通信!
#include<reg51.h>
sbit PL=P1^0;
unsigned char b;
unsigned char i;
void main(void)
{
SCON=0x10;
while(1)
{
  PL=0;
  PL=1;
  while(!RI);
   b=SBUF;
   RI=0;
   P0=b;
   for(i=0;i<255;i++);
}
}





欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1