资料下载地址-1110(百度网盘):点击下载

包含超声波传感器检测障碍物,温度传感器检测当前温度。可以通过按键设置距离报警范围,报警装置通过声光报警。包含的电路有电源电路、显示电路、语音模块电路、温度传感器电路、超声波传感器电路、报警电路等。

//宏定义
#define uchar unsigned char 
#define uint unsigned int
#define ULint unsigned long int 
//温度零上与零下的标志位
char flag=0;
//超声波
char flags=0;
//超声波距离
char flag1s=0;
//计算定时间
uint time=0;
//计算距离
ULint L_=0;
//温度
uint t_=0;
//显示模式  0正常  1最大值调整  2最小值调整
uchar mode=0;

uint Max=60;
uint Min=10;
//按键标志
uchar k=0;
//数值有误
uchar FW=0;
//头函数
#include <reg52.h>
#include <intrins.h>
#include "BJ_Key.h"	   	 //报警按键
#include "display.h"			 //显示头函数
#include "ultrasonic_wave.h"//超声波头函数
#include "DS18B20.h"	   	 //温度传感器头函数


//函数声明
void delayms(uint ms);

 

Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐