Difference between revisions of "Component: Humidity (EBM016) (EBM Modules)"

From Flowcode Help
Jump to navigationJump to search
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
+
{| style="width:50%"
 
 
{| width="50%"
 
 
|-
 
|-
| width="20%" style="color: gray;" | Author
+
| width="20%" style="color:gray;" | Author
 
| Matrix TSL
 
| Matrix TSL
 
|-
 
|-
| width="20%" style="color: gray;" | Version
+
| width="20%" style="color:gray;" | Version
| 2.0 (Release)
+
| 2.0
 
|-
 
|-
| width="20%" style="color: gray;" | Category
+
| width="20%" style="color:gray;" | Category
 
| EBM Modules
 
| EBM Modules
 
|}
 
|}
  
  
 +
==Humidity component==
 +
Humidity and temperature sensor using an SHT21 IC connected via I2C - as used by the Matrix e-block module EBM016. On screen GUI allows temperature and humidity values to be simulated, and will show all I2C communication in a console window.
  
==[[File:Component Icon 5cb8f1ac_bab2_4740_9a9d_01602a5fb196.png|Image]] Humidity  (EBM016) component==
+
==Component Source Code==
Humidity and temperature sensor using an SHT21 IC connected via I2C - as used by the
 
Matrix e-block module EBM016.
 
On screen GUI allows temperature and humidity values to be simulated, and will show all
 
I2C communication in a console window.
 
  
==Examples==
+
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_EBM016v1.fcfx FC_Comp_Source_EBM016v1.fcfx]
  
This example reads the temperature and humidity levels from the sensor and displays the readings on the LCD.
+
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_EBM016v1.fcfx FC_Comp_Source_EBM016v1.fcfx]
  
{{Fcfile|EBM016 - Test Program.fcfx|EBM016 Example}}
+
==Detailed description==
  
==Downloadable macro reference==
 
  
===<span style="font-weight: normal;"><u><tt>GetTemperatureReal</tt></u></span>===
 
Return temperature reading as a float value in degrees C
 
  
'''Parameters'''
 
  
:''This macro has no parameters''
 
  
  
'''Return value'''
 
  
:[[Variable Types|FLOAT]]
 
  
  
===<span style="font-weight: normal;"><u><tt>GetTemperatureData</tt></u></span>===
 
Returns the raw register pair value
 
  
'''Parameters'''
 
  
:''This macro has no parameters''
 
  
  
'''Return value'''
 
  
:[[Variable Types|UINT]]
 
  
  
===<span style="font-weight: normal;"><u><tt>GetTemperatureInt</tt></u></span>===
 
Return temperature reading as an integer value in degrees C
 
  
'''Parameters'''
 
  
:''This macro has no parameters''
 
  
  
'''Return value'''
 
  
:[[Variable Types|INT]]
 
  
  
===<span style="font-weight: normal;"><u><tt>GetHumidityInt</tt></u></span>===
+
''No detailed description exists yet for this component''
returns the relative Humidity reading as an integer value
 
  
'''Parameters'''
+
==Examples==
  
:''This macro has no parameters''
 
  
  
'''Return value'''
 
  
:[[Variable Types|INT]]
 
  
  
===<span style="font-weight: normal;"><u><tt>GetHumidityReal</tt></u></span>===
 
returns the Humidity reading as a float value
 
  
'''Parameters'''
 
  
:''This macro has no parameters''
 
  
  
'''Return value'''
 
  
:[[Variable Types|FLOAT]]
 
  
  
===<span style="font-weight: normal;"><u><tt>GetHumidityData</tt></u></span>===
 
Returns the raw register pair value
 
  
'''Parameters'''
 
  
:''This macro has no parameters''
 
  
  
'''Return value'''
 
  
:[[Variable Types|UINT]]
 
  
  
  
==Simulation macro reference==
 
  
''This component does not contain any simulation macros''
 
  
  
==Property reference==
 
<span style="font-weight: normal;"><u>Channel</u></span>
 
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_i2c1::CHANNEL''.
+
This example reads the temperature and humidity levels from the sensor and displays the readings on the LCD.
  
Channel selection
+
{{Fcfile|EBM016 - Test Program.fcfx|EBM016 Example}}
  
<span style="font-weight: normal;"><u>SDA</u></span>
 
  
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_i2c1::SDA''.
 
  
Pin used for SDA (data signal)
 
  
<span style="font-weight: normal;"><u>SCL</u></span>
 
  
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_i2c1::SCL''.
 
  
Pin used for SCL (clock signal)
 
  
<span style="font-weight: normal;"><u>SDA Remap Pin</u></span>
 
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_i2c1::SDAPins''.
 
  
''<span style="color:red;">No additional information</span>''
 
  
  
 +
==Macro reference==
  
<span style="font-weight: normal;"><u>SCL Remap Pin</u></span>
+
===GetHumidityData===
 +
{| 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;" | '''GetHumidityData'''
 +
|-
 +
| colspan="2" | Returns the raw register pair value&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_i2c1::SCLPins''.
 
  
''<span style="color:red;">No additional information</span>''
+
===GetHumidityInt===
 +
{| 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&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
  
 +
===GetHumidityReal===
 +
{| 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&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
<span style="font-weight: normal;"><u>Baud Select</u></span>
 
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_i2c1::BAUD_LIST''.
+
===GetTemperatureData===
 +
{| 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&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
Baud rate option selector
 
  
<span style="font-weight: normal;"><u>Baud Rate</u></span>
+
===GetTemperatureInt===
 +
{| 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&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
This property is of type ''Signed integer'' and can be referenced with the variable name ''cal_i2c1::BAUD''.
 
  
Baud rate to be used
+
===GetTemperatureReal===
 +
{| 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&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
<span style="font-weight: normal;"><u>Stop Delay</u></span>
 
  
This property is of type ''True or false'' and can be referenced with the variable name ''cal_i2c1::StopDel''.
+
===Initialise===
 +
{| 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;" | '''Initialise'''
 +
|-
 +
| colspan="2" | Initialises the component ready for I2C communications&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
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.
+
==Property reference==
  
 
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
Most modern microcontrollers will not have a problem so this property can be disabled to speed up the
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
I2C communications.
+
|-
 
+
|-
<span style="font-weight: normal;"><u>Simulation Type</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Channel
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''SimType''.
+
|-
 
+
| colspan="2" | Channel selection&nbsp;
''<span style="color:red;">No additional information</span>''
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
+
| width="90%" | SDA
 
+
|-
<span style="font-weight: normal;"><u>Scope Traces</u></span>
+
| colspan="2" | Pin used for SDA (data signal)&nbsp;
 
+
|-
This property is of type ''True or false'' and can be referenced with the variable name ''cal_i2c1::ScopeTraces''.
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
+
| width="90%" | SCL
Selects if the component pin connections are automatically generated on the data recorder window or not.
+
|-
 
+
| colspan="2" | Pin used for SCL (clock signal)&nbsp;
Yes: Automatically add the component pins to a group on the data recorder which will reflect the sim data during simultion.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
No: Do not show the pin signals on the data recorder window.
+
| width="90%" | Baud Select
 
+
|-
<span style="font-weight: normal;"><u>Console Data</u></span>
+
| colspan="2" | Baud rate option selector&nbsp;
 
+
|-
This property is of type ''True or false'' and can be referenced with the variable name ''cal_i2c1::ConsoleData''.
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 
+
| width="90%" | Baud Rate
Selects if the console data is automatically generated or not
+
|-
 
+
| colspan="2" | Baud rate to be used&nbsp;
<span style="font-weight: normal;"><u>Injector</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_i2c1::Injector''.
+
| width="90%" | Stop Delay
 
+
|-
''<span style="color:red;">No additional information</span>''
+
| 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. &nbsp;
 +
|-
 +
| 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" | &nbsp;
 +
|}

Latest revision as of 13:09, 7 February 2023

Author Matrix TSL
Version 2.0
Category EBM Modules


Humidity component

Humidity and temperature sensor using an SHT21 IC connected via I2C - as used by the Matrix e-block module EBM016. 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_EBM016v1.fcfx

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

Detailed description

No detailed description exists yet for this component

Examples

This example reads the temperature and humidity levels from the sensor and displays the readings on the LCD.

FC6 Icon.png EBM016 Example






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-5-icon.png SCL
Pin used for SCL (clock signal) 
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