51单片机c语言dht11,基于51单片机的dht11温湿度数码管显示

  • Post author:
  • Post category:其他


bit DHT_Start();

bit DHT_ByteRead(unsigned char *dat);

void ConfigTimer0(unsigned int ms);

void Display_hum(unsigned char *num);

void Display_temp(unsigned char *num);

unsigned char T0RH = 0;  //T0重载值的高字节

unsigned char T0RL = 0;  //T0重载值的低字节

unsigned char str=88;

unsigned char DHT[5];

unsigned int tmr1s = 0;

unsigned int tmr10ms = 0;

unsigned char st=0;

unsigned int sdd=0;

unsigned char td=0;

unsigned char mode=0;

bit flag1s = 0;

bit flag10ms = 0;

int x;

sbit button1=P0^0;

sbit dot=P1^3;   //数码管小数点

void delay(unsigned char x)   //延时ms

{

unsigned char a,b,c;

for(c=x;c>0;c–)

{

for(b=102;b>0;b–)

for(a=3;a>0;a–);

}

}<