Component: Temp / Humidity (DHT22) (Environmental): Difference between revisions
Appearance
No edit summary |
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder"" |
||
| (5 intermediate revisions by the same user not shown) | |||
| Line 90: | Line 90: | ||
===GetHumidityFloat=== | ===GetHumidityFloat=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''GetHumidityFloat''' | ||
|- | |- | ||
| colspan="2" | Gets the humidity returned by calling SampleSensor as a floating point number. If humidity is 15.8 % then this function would return 15.8. | | colspan="2" | Gets the humidity returned by calling SampleSensor as a floating point number. If humidity is 15.8 % then this function would return 15.8. | ||
| Line 104: | Line 104: | ||
===GetHumidityReal=== | ===GetHumidityReal=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''GetHumidityReal''' | ||
|- | |- | ||
| colspan="2" | Gets the real number portion of the humidity returned by calling SampleSensor. If humidity is 15.8 % then this function would return 8. | | colspan="2" | Gets the real number portion of the humidity returned by calling SampleSensor. If humidity is 15.8 % then this function would return 8. | ||
| Line 118: | Line 118: | ||
===GetHumidityString=== | ===GetHumidityString=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''GetHumidityString''' | ||
|- | |- | ||
| colspan="2" | Gets the humidity returned by calling SampleSensor as a string. If humidity is 15.8 % then this function would return "15.8". | | colspan="2" | Gets the humidity returned by calling SampleSensor as a string. If humidity is 15.8 % then this function would return "15.8". | ||
| Line 132: | Line 132: | ||
===GetHumidityWhole=== | ===GetHumidityWhole=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''GetHumidityWhole''' | ||
|- | |- | ||
| colspan="2" | Gets the whole number portion of the humidity returned by calling SampleSensor. If humidity is 15.8 % then this function would return 15. | | colspan="2" | Gets the whole number portion of the humidity returned by calling SampleSensor. If humidity is 15.8 % then this function would return 15. | ||
| Line 146: | Line 146: | ||
===GetTempFloat=== | ===GetTempFloat=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''GetTempFloat''' | ||
|- | |- | ||
| colspan="2" | Gets the temperature returned by calling SampleSensor as a floating point number. If temperature is 15.8 degrees C then this function would return 15.8. | | colspan="2" | Gets the temperature returned by calling SampleSensor as a floating point number. If temperature is 15.8 degrees C then this function would return 15.8. | ||
| Line 160: | Line 160: | ||
===GetTempReal=== | ===GetTempReal=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''GetTempReal''' | ||
|- | |- | ||
| colspan="2" | 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. | | colspan="2" | 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. | ||
| Line 174: | Line 174: | ||
===GetTempString=== | ===GetTempString=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''GetTempString''' | ||
|- | |- | ||
| colspan="2" | Gets the temperature returned by calling SampleSensor as a string. If temperature is 15.8 degrees C then this function would return "15.8". | | colspan="2" | Gets the temperature returned by calling SampleSensor as a string. If temperature is 15.8 degrees C then this function would return "15.8". | ||
| Line 188: | Line 188: | ||
===GetTempWhole=== | ===GetTempWhole=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''GetTempWhole''' | ||
|- | |- | ||
| colspan="2" | 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. | | colspan="2" | 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. | ||
| Line 202: | Line 202: | ||
===SampleSensor=== | ===SampleSensor=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SampleSensor''' | ||
|- | |- | ||
| colspan="2" | Communicates with the DHT22 sensor and receives the temperature and humidity readings. Returns 0 for success, 1 for no communication detected and 2 for checksum error. | | colspan="2" | Communicates with the DHT22 sensor and receives the temperature and humidity readings. Returns 0 for success, 1 for no communication detected and 2 for checksum error. | ||
| Line 217: | Line 217: | ||
==Property reference== | ==Property reference== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Properties''' | ||
|- | |- | ||
|- | |- | ||
| Line 233: | Line 233: | ||
| colspan="2" | The checksum value is used to ensure the data being received is correct. Yes = Only receive data if checksum is correct No = Ignore checksum | | colspan="2" | The checksum value is used to ensure the data being received is correct. Yes = Only receive data if checksum is correct No = Ignore checksum | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | Advanced Settings | ||
|- | |- | ||
|- | |- | ||
Latest revision as of 14:37, 13 July 2026
| Author | Matrix TSL |
| Version | 1.2 |
| Category | Environmental |
Temp / Humidity (DHT22) component
The DHT22 temperature and humidity sensor is a popular sensor allowing the ambient temperature and relative humidity to be monitored digitally. Humidity Range = 0% - 100% +/- 2% Temperature Range = -40 - 80 Degrees C +/- 0.5 Degrees C
Component Source Code
Please click here to download the component source project: FC_Comp_Source_DHT22.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_DHT22.fcfx
Detailed description
No detailed description exists yet for this component
Examples
Example Program showing how to sample the DHT22 sensor and show the temperature and humidity on an LCD.
DHT22 Example
Macro reference
GetHumidityFloat
| GetHumidityFloat | |
| Gets the humidity returned by calling SampleSensor as a floating point number. If humidity is 15.8 % then this function would return 15.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 | |
GetHumidityString
| GetHumidityString | |
| Gets the humidity returned by calling SampleSensor as a string. If humidity is 15.8 % then this function would return "15.8". | |
| 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 | |
GetTempFloat
| GetTempFloat | |
| Gets the temperature returned by calling SampleSensor as a floating point number. If temperature is 15.8 degrees C then this function would return 15.8. | |
| 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 | |
GetTempString
| GetTempString | |
| Gets the temperature returned by calling SampleSensor as a string. If temperature is 15.8 degrees C then this function would return "15.8". | |
| Return | |
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 | |
SampleSensor
| SampleSensor | |
| Communicates with the DHT22 sensor and receives the temperature and humidity readings. Returns 0 for success, 1 for no communication detected and 2 for checksum error. | |
| Return | |