Page 1 of 1

Measurement of temperature and relative humidity using DHT11

Posted: Wed Jul 11, 2012 6:41 pm
by STibor
Hi!
How Flowcode to rewrite the following C program?
http://embedded-lab.com/blog/?p=4333
The most important part of the program:

Code: Select all

unsigned short ReadByte(){
  unsigned short num = 0, t;
  DataDir = 1;
  for (i=0; i<8; i++){
   while(!Data);
   Delay_us(40);
   if(Data) num |= 1<<(7-i);
   while(Data);
   }
  return num;
}
Thank you for your answers!

Re: Measurement of temperature and relative humidity using D

Posted: Thu Jul 12, 2012 9:32 am
by Benj
Hello,

Here is an example macro that should help.

Re: Measurement of temperature and relative humidity using D

Posted: Thu Jul 12, 2012 7:40 pm
by STibor
Hi, Ben!
I think it works!
Thank you very much!