Difference between revisions of "Component: Temp / Humidity (SHT21) (Environmental)"

From Flowcode Help
Jump to navigationJump to search
 
(7 intermediate revisions by the same user not shown)
Line 16: Line 16:
  
 
==Component Source Code==
 
==Component Source Code==
 +
 +
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_Humidity_SHT21.fcfx FC_Comp_Source_Humidity_SHT21.fcfx]
  
 
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Humidity_SHT21.fcfx FC_Comp_Source_Humidity_SHT21.fcfx]
 
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Humidity_SHT21.fcfx FC_Comp_Source_Humidity_SHT21.fcfx]
  
 
==Detailed description==
 
==Detailed description==
 +
 +
 +
 +
 +
 +
  
  
Line 40: Line 48:
  
 
==Examples==
 
==Examples==
 +
 +
 +
 +
 +
 +
  
  
Line 61: Line 75:
  
  
==Macro reference==
 
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTemperatureReal'''
 
|-
 
| colspan="2" | Return temperature reading as a float value in degrees C 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTemperatureData'''
 
|-
 
| colspan="2" | Returns the raw register pair value 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTemperatureInt'''
 
|-
 
| colspan="2" | Return temperature reading as an integer value in degrees C 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetHumidityInt'''
 
|-
 
| colspan="2" | returns the relative Humidity reading as an integer value 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetHumidityReal'''
 
|-
 
| colspan="2" | returns the Humidity reading as a float value 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
 +
 +
==Macro reference==
 +
 +
===GetHumidityData===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 141: Line 103:
  
  
 +
===GetHumidityInt===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetHumidityInt'''
 
|-
 
|-
| colspan="2" | Initialises the component ready for I2C communications 
+
| colspan="2" | returns the relative Humidity reading as an integer value 
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 
+
===GetHumidityReal===
 
 
==Property reference==
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel selection 
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | SDA
 
|-
 
| colspan="2" | Pin used for SDA (data signal) 
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | SCL
 
|-
 
| colspan="2" | Pin used for SCL (clock signal) 
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Baud Select
 
|-
 
| colspan="2" | Baud rate option selector 
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 
| width="90%" | Baud Rate
 
|-
 
| colspan="2" | Baud rate to be used 
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Stop Delay
 
|-
 
| colspan="2" | On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not  a 10ms delay between an I2C stop event and the next I2C start event.  Most modern microcontrollers will not have a problem so this property can be disabled to speed up the  I2C communications.  
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Simulation Comms
 
|-
 
| colspan="2" |  
 
|}==Macro reference==
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTemperatureReal'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetHumidityReal'''
 
|-
 
|-
| colspan="2" | Return temperature reading as a float value in degrees C 
+
| colspan="2" | returns the Humidity reading as a float value 
 
|-
 
|-
 
|-
 
|-
Line 217: Line 131:
  
  
 +
===GetTemperatureData===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 230: Line 145:
  
  
 +
===GetTemperatureInt===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 243: Line 159:
  
  
 +
===GetTemperatureReal===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetHumidityInt'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTemperatureReal'''
 
|-
 
|-
| colspan="2" | returns the relative Humidity reading as an integer value 
+
| colspan="2" | Return temperature reading as a float value in degrees C 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetHumidityReal'''
 
|-
 
| colspan="2" | returns the Humidity reading as a float value 
 
 
|-
 
|-
 
|-
 
|-
Line 269: Line 173:
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
===Initialise===
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetHumidityData'''
 
|-
 
| colspan="2" | Returns the raw register pair value 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 293: Line 185:
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 
 
  
  
Line 314: Line 204:
 
|-
 
|-
 
| colspan="2" | Pin used for SDA (data signal) 
 
| colspan="2" | Pin used for SDA (data signal) 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | SDA Remap Pin
 +
|-
 +
| colspan="2" |  
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
Line 319: Line 214:
 
|-
 
|-
 
| colspan="2" | Pin used for SCL (clock signal) 
 
| colspan="2" | Pin used for SCL (clock signal) 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | SCL Remap Pin
 +
|-
 +
| colspan="2" |  
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]

Latest revision as of 10:26, 20 October 2023

Author Matrix TSL
Version 2.0
Category Environmental


Temp / Humidity (SHT21) component

Humidity and temperature sensor using an SHT21 IC connected via I2C. On screen GUI allows temperature and humidity values to be simulated, and will show all I2C communication in a console window.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_Humidity_SHT21.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_Humidity_SHT21.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples








Macro reference

GetHumidityData

Fc9-comp-macro.png GetHumidityData
Returns the raw register pair value 
Fc9-u16-icon.png - UINT Return


GetHumidityInt

Fc9-comp-macro.png GetHumidityInt
returns the relative Humidity reading as an integer value 
Fc9-s16-icon.png - INT Return


GetHumidityReal

Fc9-comp-macro.png GetHumidityReal
returns the Humidity reading as a float value 
Fc9-f32-icon.png - FLOAT Return


GetTemperatureData

Fc9-comp-macro.png GetTemperatureData
Returns the raw register pair value 
Fc9-u16-icon.png - UINT Return


GetTemperatureInt

Fc9-comp-macro.png GetTemperatureInt
Return temperature reading as an integer value in degrees C 
Fc9-s16-icon.png - INT Return


GetTemperatureReal

Fc9-comp-macro.png GetTemperatureReal
Return temperature reading as a float value in degrees C 
Fc9-f32-icon.png - FLOAT Return


Initialise

Fc9-comp-macro.png Initialise
Initialises the component ready for I2C communications 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png Channel
Channel selection 
Fc9-type-5-icon.png SDA
Pin used for SDA (data signal) 
Fc9-type-16-icon.png SDA Remap Pin
 
Fc9-type-5-icon.png SCL
Pin used for SCL (clock signal) 
Fc9-type-16-icon.png SCL Remap Pin
 
Fc9-type-16-icon.png Baud Select
Baud rate option selector 
Fc9-type-14-icon.png Baud Rate
Baud rate to be used 
Fc9-type-7-icon.png Stop Delay
On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not a 10ms delay between an I2C stop event and the next I2C start event. Most modern microcontrollers will not have a problem so this property can be disabled to speed up the I2C communications.  
Fc9-conn-icon.png Simulation
Fc9-type-7-icon.png Simulation Comms