基于单片机四路多路超声波雷达测距系统设计-毕设课设资料
【资源下载】下载地址如下1506:
https://docs.qq.com/doc/DTlRSd01BZXNpRUxl
#include "LCD1602DRV.h"
#include "STCEEPROM.h"
sbit RX1 = P3^3;
sbit RX2 = P3^4;
sbit RX3 = P3^5;
sbit RX4 = P3^6;
sbit TX = P3^7;
sbit LED3 = P2^2;
sbit LED2 = P2^1;
sbit LED1 = P2^0;
sbit SPEAK = P2^3;
sbit KEY1 = P1^3;
sbit KEY2 = P1^4;
sbit KEY3 = P1^5;
uint time=0;
uint timer=0;
uint S=0,S1=0,S2=0,S3=0,S4=0;
bit flag =0;
uchar KEY_flag=0;
//延时函数
void Conut(void)
{
time=TH0*256+TL0;
TH0=0;
TL0=0;
S=(time*1.87)/100; //算出来是CM
if((S>=700)||flag==1) //超出测量范围显示“-”
{
flag=0;
}
}
void main(void)
{
uint SET_H=90,SET_L=30;
LCD1602_Init();//液晶初始化
SetRowCol(0,0);
printf("000 000 000 000");
SetRowCol(1,0);