基于51单片机的DHT11数字温湿度计.docxVIP

  • 18
  • 0
  • 约2.9千字
  • 约 5页
  • 2018-02-12 发布于河南
  • 举报
基于51单片机的DHT11数字温湿度计

#include reg52.h#include intrins.h#define uchar unsigned char#define uint unsigned intuchar byte,SH,SL,WH,WL,CHECK,FLAG;sbit LCDRS=P3^2;sbit LCDEN=P3^3;//sbit LCDRW=P2^2;sbit BUS=P3^4;void delay(uchar ms) //精确1ms{uchar i,j;for(i=ms*5;i0;i--)for(j=100;j0;j--);}void delay1() //约7us{uchar i; for(i=3;i0;i--);}/***************LCD配置**********************//********************bit check_busy()//检测busy{uchar temp;bit BB;LCDRS=0;LCDRW=1;LCDEN=1;P0=temp;delay(5);LCDEN=0;BB=(bit)(temp0x80);//检测D7是否为1,为1则忙return BB;}*********************/void write_com(uchar com){//while(check_busy());//检测LCD是否忙delay(5)

文档评论(0)

1亿VIP精品文档

相关文档