25 基于51单片机的温度电流电压检测系统(压力、电压、温度、电流、LCD1602)

目录

一、主要功能

二、硬件资源

三、程序编程

四、实现现象


一、主要功能

基于51单片机,通过DS18B20检测温度,滑动变阻器连接数模转换器模拟电流、电压,通过LCD1602显示,程序里设置温度阈值为40,电流阈值为60,电压阈值为100,如果超于阈值,则蜂鸣器报警。

二、硬件资源

基于KEIL5编写C++代码,PROTEUS8.15进行仿真,全部资源在页尾,提供安装包。

编辑

三、程序编程

#include <REGX52.H>#include<intrins.h>#include<stdio.h>#include "Delay.h"#include "LCD1602.h"#define uchar unsigned char#define uint unsigned  intsbit beep = P2^5;			  //蜂鸣器引脚sbit DS=P2^4;                 //DS18B20温度传感器sbit DS1=P2^3;                 //DS18B20温度传感器sbit CS=P1^0;                 //adc0832引脚sbit CLK=P1^1;
sbit DIO=P1^2;
sbit CS1=P1^3;                 //adc0832引脚sbit CLK1=P1^4;
sbit DIO1=P1^5;
sbit CS2   =  P1^6;        //ADC0832引脚定义sbit CLK2  =  P1^7;
sbit DIO2  =  P2^6;unsigned char count;typedef unsigned char u8;typedef unsigned int  u16;static uint temp;static float ftemp = 0.0f;//温度转变uint temp;static uint temp1;static float ftemp1= 0.0f;//温度转变uint temp1;static unsigned char num;static int wdyz=40,dymax=100,dlmax=60;  //wd38static uchar u,U,R ,u1,U1,R1,u2,U2,R2;      //定义变量void tmpchange();uint tmp();void tmpchange1();uint tmp1();void beep\_warning();void Time0\_Init()    &nbs
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值