Measurement of temperature and relative humidity using DHT11

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
User avatar
STibor
Posts: 263
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 116 times
Been thanked: 113 times
Contact:

Measurement of temperature and relative humidity using DHT11

Post 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!

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Measurement of temperature and relative humidity using D

Post by Benj »

Hello,

Here is an example macro that should help.
Attachments
DHT11.fcf
(13 KiB) Downloaded 577 times

User avatar
STibor
Posts: 263
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 116 times
Been thanked: 113 times
Contact:

Re: Measurement of temperature and relative humidity using D

Post by STibor »

Hi, Ben!
I think it works!
Thank you very much!
Attachments
DHT11_.jpg
DHT11_.jpg (43.82 KiB) Viewed 4096 times

Post Reply