Jump to content

Component: Temp / Humidity (SHT31) (Environmental): Difference between revisions

From Flowcode Help
No edit summary
No edit summary
Line 12: Line 12:




==Temp / Humidity component==
==Temp / Humidity (SHT31) component==
Humidity and temperature sensor using an SHT31 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.
Humidity and temperature sensor using an SHT31 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.


Line 20: Line 20:


==Detailed description==
==Detailed description==




Line 34: Line 36:


==Examples==
==Examples==





Revision as of 14:41, 16 January 2023

Author Matrix TSL
Version 2.0
Category Environmental


Temp / Humidity (SHT31) component

Humidity and temperature sensor using an SHT31 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 for the component source code: FC_Comp_Source_Humidity_SHT31.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples


Downloadable macro reference

GetTemperatureReal
Return temperature reading as a float value in degrees C 
- FLOAT Return


GetTemperatureData
Returns the raw register pair value 
- UINT Return


GetTemperatureInt
Return temperature reading as an integer value in degrees C 
- INT Return


GetHumidityInt
returns the relative Humidity reading as an integer value 
- INT Return


GetHumidityReal
returns the Humidity reading as a float value 
- FLOAT Return


GetHumidityData
Returns the raw register pair value 
- UINT Return


Initialise
Configures the I2C peripheral and puts the sensor into one shot mode ready to be sampled. Must be called before calling any of the other component macros. Returns 1 if the sensor has been intialised correctly, else returns 0. 
- BYTE Return



Property reference

Properties
Address
Selects the correct device address based on the ADDR pin connection to VDD or VSS. 
Channel
Channel selection 
SDA
Pin used for SDA (data signal) 
SCL
Pin used for SCL (clock signal) 
Baud Select
Baud rate option selector 
Baud Rate
Baud rate to be used 
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.  
Simulation
Simulation Comms