基于c51单片机的温湿度测量仪的主程序(C51 microcontroller based temperature and humidity measuring instrument of the main program).docVIP
- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
基于c51单片机的温湿度测量仪的主程序(C51 microcontroller based temperature and humidity measuring instrument of the main program)
基于c51单片机的温湿度测量仪的主程序(C51 microcontroller based temperature and humidity measuring instrument of the main program)
/ / save the file name for the main.c
/********************************************************************************************/
/ / phenomenon is cyclic display temperature and humidity display all three seconds
#include dht11.h
#include REGX51.H
#define uint unsigned int
#define uchar unsigned char
Sbit Key_ce=P1^3;
Sbit Seg_ce=P1^0;
Sbit Dig_ce=P1^1;
Static unsigned char flag; / / interrupt count sign
Static unsigned char code array[]= {0x3f, 0x06,0x5b, 0x4f, 0x66,0x6d, 0x7d, 0x07,0x7f, 0x6f}; / / digital encoding
Static, unsigned, int, t_high, t_low, t_shi, t_ge;
Static, unsigned, int, h_shi, h_ge;
Static, int, high_temp=30, low_temp=10;
Static, int, high_humi=90, low_humi=30;
Extern, int, temp_value, humi_value;
Static void InitTime (void);
Static void keyscan (void);
Void Delay_1ms (unsigned, int, MS);
Static, void, SMG_Display (unsigned, int, value);
Int main (void)
{
Unsigned char mark = 0;
Int fuc=0;
P0=0; P1=0X0C; P1_4=1;
Delay_1ms (1000); / / electrical stability first etc.
(ReadTempAndHumi); / / read a data because DHT11 will trigger a data acquisition. The prior use of a data acquisition data
Delay_1ms (3000); / / because in the two data collection for a certain time interval, it can also reduce
(InitTime); / / set the timer
While (1)
{
/ / 3 seconds read once the temperature and humidity used interrupt
If (flag==61) / / because the program is too long, time compensation
{
Flag = 0;
Mark++;
/ * read the temperature and humidity, can detect whether the function call fails, the function returns OK (1) said, return to the ERROR (0) OK and ERROR indicates that the failure is defined in the DHT11.H macro.
ReadTempAndHumi ();
If (temp_value=high_temp||temp_value=low_temp) {P1_4=0; P1_2=0; P0_4=1; P0_5=1;}
Else {P1_4=1; P1_2=1;}
If (humi_value=high_humi||humi_value=low_humi) {P1_4=0; P1_2=0; P0_6=1; P0_7=1;}
Else {P1_4=1; P1_2=1;}
}
If (Mark% 2=
您可能关注的文档
- 品位住宅小区的规划与设计(Planning and design of grade residential district).doc
- 品牌年轻化之道(Brand younger road).doc
- 品高_铁路工程资料管理系统_自述文件(High quality _ railway engineering data management system _ readme file).doc
- 品牌接触点定义分类与相关测量方法(Brand contact definition, classification and related measurement methods).doc
- 哄女朋友三十六计(时代版)(Coax girlfriend thirty-six meter (time Edition)).doc
- 哈哈啊(Ha ha!).doc
- 哈哥兔业要把产业做强城市做大(Ha rabbit brother the industry stronger and bigger city).doc
- 哈尔滨市主要街道新旧街名对照表(Comparison table of old and new streets in main streets of Harbin).doc
- 哈语(Kazakh).doc
- 哲学常识(Philosophical knowledge).doc
- 基于atmega128与gprs的远程数据采集系统的设计(Design of remote data acquisition system based on ATmega128 and GPRS).doc
- 基于ds18b20的温湿度采集系统设计(Design of temperature and humidity acquisition system based on DS18B20).doc
- 基于at89c2051单片机应用设计(Application design based on AT89C2051 microcontroller).doc
- 基于msp430g2553的多通道输入adc(Multichannel input ADC based on msp430g2553).doc
- 基于batc 1999-2008十年观测值班记录的兴隆天气情况统计(Statistics of booming weather conditions based on batc 1999-2008 and ten year observation of duty record).doc
- 基于plc的辊压机控制系统设计2(Design of roller press control system based on PLC 2).doc
- 基于vc与ansys的齿轮分析系统,apdl文件(Gear analysis system based on VC and ANSYS, APDL file).doc
- 基于vc++6.0和ansys高压线路覆冰力学分析系统的软件设计(Software design of mechanical analysis system of icing on high voltage line based on vc++6.0 and ANSYS).doc
- 基于单片机的交通灯(Traffic light based on single chip microcomputer).doc
- 基于vc 60和ansys高压线路覆冰力学分析系统的软件设计(Software design of icing mechanical analysis system for high voltage line based on VC 60 and ANSYS).doc
最近下载
- 数字产业集聚与区域经济韧性——基于省级面板数据的实证分析.pdf VIP
- 职业中学学生职业选择与学习动机研究教学研究课题报告.docx
- PGT25PLUS燃气轮机结构介绍(参考).ppt VIP
- 10.多撇不同向 课件-六年级上册小学书法(苏少版).pptx VIP
- 11一字无二捺 教学课件 六年级上册书法(苏少版).ppt VIP
- 2025年元宇宙产业发展趋势报告:区块链技术基础设施建设创新.docx VIP
- 跨境电商出口跨境电商行业跨境电商出口市场分析与发展趋势报告.docx
- 初中数学教学中推理能力的培养与数学学习策略的关系研究教学研究课题报告.docx
- 跨境电商跨境电商平台跨境电商平台跨境电商平台运营策略研究报告.docx
- 1平正安稳 教学课件 六年级下册书法(苏少版).ppt VIP
文档评论(0)