云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 毕业设计(论文)基于at89c51单片机温湿度显示报警系统设计

毕业设计(论文)基于at89c51单片机温湿度显示报警系统设计

  • 62 次阅读
  • 3 次下载
  • 2025/5/4 23:29:36

附录

[%RH]

if(rh_true>100)rh_true=100; //cut if the value is outside of if(rh_true<0.1)rh_true=0.1; //the physical possible range

*p_temperature=t_C; //return temperature [C] *p_humidity=rh_true; //return humidity[%RH] }

/**************第二部分SHT10设置 END*****************************/

/***************************主函************************************/ void main(void) {

value humi_val,temp_val;

unsigned char error,checksum,i;

LcdRw=0;

led1=0; led2=0; start=0;

s_connectionreset(); welcome();//显示欢迎画面 delay(2000);

LCD_Initial();

while(1) { error=0;

error+=s_measure((unsigned char*) &humi_val.i,&checksum,HUMI); error+=s_measure((unsigned char*) &temp_val.i,&checksum,TEMP); if(error!=0)

第41页(共43页)

基于单片机温湿度显示报警系统设计

s_connectionreset(); //in case of an error: connection reset

else {

humi_val.f=(float)humi_val.i; //converts integer to float

temp_val.f=(float)temp_val.i; //converts integer to float calc_sht90(&humi_val.f,&temp_val.f); //计算湿度与温度

GotoXY(0,0);//

Print(\

GotoXY(0,1);

Print(\

zhuanhuan(temp_val.f); //转换温度为uchar方便液晶显示

GotoXY(5,0);

str[5]=0xDF;//℃的符号

str[6]=0x43;

str[7]='\\0';

Print(str);

if( temp_val.f>TEMPUP-1 || temp_val.f

led1=1; else

led1=0;

zhuanhuan(humi_val.f);//转换湿度为uchar方便液晶显示

GotoXY(5,1);

str[5]='%';//%的符号

str[6]='\\0';//字符串结束标志

Print(str);

if( humi_val.f>HUMUP-1 || humi_val.f

led2=1; else

第42页(共43页)

附录

led2=0; }

delay_n10us(80000); //延时约0.8s

} }

第43页(共43页)

  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

附录 [%RH] if(rh_true>100)rh_true=100; //cut if the value is outside of if(rh_true<0.1)rh_true=0.1; //the physical possible range *p_temperature=t_C; //return temperature [C] *p_humidity=rh_true; //return humidity[%RH] } /**************第二部分SHT10设置 END*****************************/ /***************************主

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com