/*****************************************************************************/Name:LCD1602+US-100+STC89C52HC-SR04超声波测距模块串口程序晶振:11
0592MDesignedby:庶野琴风Date:2016/08/11QQ:397739038接线:模块TRIG接P3
1ECH0接P3
0RS(CS)接P2
0;RW(SID)接P2
1;E(SCLK)接P2
2;BF接P0
7;/*****************************************************************************/#include#include#definenops{_nop_();_nop_();_nop_();_nop_();}/******************************引脚及变量的定义****************************/sbitRS=P2^0;//寄存器选择位sbitRW=P2^1;//读取选择位sbitE=P2^2;//使能信号位sbitBF=P0^7;//忙碌信号位unsignedcharcodeTab[]={"0123456789"};unsignedcharcodestring[]={"range:2cm--4
5m"};charpart,ge,shi,bai;charidataGLengthLoh[2];//接收缓冲区bitsuccess_flag;//定义测试成功标志位/*********************************************************//*********函数名称:delay1ms(void)******************//**