Difference between revisions of "Component: Temp / Humidity (DHT11) (Environmental)"
From Flowcode Help
Jump to navigationJump to searchLine 74: | Line 74: | ||
Example Program showing how to sample the DHT11 sensor and show the temperature and humidity on an LCD. | Example Program showing how to sample the DHT11 sensor and show the temperature and humidity on an LCD. | ||
{{Fcfile|DHT11_Example.fcfx|DHT11 Example}} | {{Fcfile|DHT11_Example.fcfx|DHT11 Example}} | ||
+ | |||
+ | |||
Line 79: | Line 81: | ||
==Macro reference== | ==Macro reference== | ||
+ | ===GetTempWhole=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 92: | Line 95: | ||
+ | ===GetHumidityFloat=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 105: | Line 109: | ||
+ | ===GetTempString=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 118: | Line 123: | ||
+ | ===GetHumidityString=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 131: | Line 137: | ||
+ | ===GetHumidityWhole=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 144: | Line 151: | ||
+ | ===GetTempReal=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 157: | Line 165: | ||
+ | ===GetHumidityReal=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 170: | Line 179: | ||
+ | ===SampleSensor=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 183: | Line 193: | ||
+ | ===GetTempFloat=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- |
Revision as of 11:49, 3 February 2023
Author | Matrix TSL |
Version | 1.1 |
Category | Environmental |
Contents
Temp / Humidity (DHT11) component
The DHT11 temperature and humidity sensor is a popular sensor allowing the ambient temperature and relative humidity to be monitored digitally. Humidity Range = 20% - 90% +/- 5% Temperature Range = 0 - 50 Degrees C +/- 2 Degrees C
Component Source Code
Please click here to download the component source project: FC_Comp_Source_DHT11.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_DHT11.fcfx
Detailed description
No detailed description exists yet for this component
Examples
Example Program showing how to sample the DHT11 sensor and show the temperature and humidity on an LCD.
DHT11 Example
Macro reference
GetTempWhole
![]() |
GetTempWhole |
Gets the whole number portion of the temperature returned by calling SampleSensor. If temperature is 15.8 degrees C then this function would return 15. | |
![]() |
Return |
GetHumidityFloat
![]() |
GetHumidityFloat |
Gets the humidity returned by calling SampleSensor as a floating point number. | |
![]() |
Return |
GetTempString
![]() |
GetTempString |
Gets the temperature returned by calling SampleSensor as a string. | |
![]() |
Return |
GetHumidityString
![]() |
GetHumidityString |
Gets the humidity returned by calling SampleSensor as a string. | |
![]() |
Return |
GetHumidityWhole
![]() |
GetHumidityWhole |
Gets the whole number portion of the humidity returned by calling SampleSensor. If humidity is 15.8 % then this function would return 15. | |
![]() |
Return |
GetTempReal
![]() |
GetTempReal |
Gets the real number portion of the temperature returned by calling SampleSensor. If temperature is 15.8 degrees C then this function would return 8. | |
![]() |
Return |
GetHumidityReal
![]() |
GetHumidityReal |
Gets the real number portion of the humidity returned by calling SampleSensor. If humidity is 15.8 % then this function would return 8. | |
![]() |
Return |
SampleSensor
![]() |
SampleSensor |
Communicates with the DHT11 sensor and receives the temperature and humidity readings. Returns 0 for success, 1 for no communication detected and 2 for checksum error. | |
![]() |
Return |
GetTempFloat
![]() |
GetTempFloat |
Gets the temperature returned by calling SampleSensor as a floating point number. | |
![]() |
Return |