Component: Temp Humidity (SHT31) (Environmental)

From Flowcode Help
Jump to navigationJump to search


Author Matrix TSL
Version 2.0 (Release)
Category Environmental


Image 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.

Examples

No additional examples


Downloadable macro reference

GetTemperatureReal

Return temperature reading as a float value in degrees C

Parameters

This macro has no parameters


Return value

FLOAT


GetTemperatureData

Returns the raw register pair value

Parameters

This macro has no parameters


Return value

UINT


GetTemperatureInt

Return temperature reading as an integer value in degrees C

Parameters

This macro has no parameters


Return value

INT


GetHumidityInt

returns the relative Humidity reading as an integer value

Parameters

This macro has no parameters


Return value

INT


GetHumidityReal

returns the Humidity reading as a float value

Parameters

This macro has no parameters


Return value

FLOAT


GetHumidityData

Returns the raw register pair value

Parameters

This macro has no parameters


Return value

UINT


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.

Parameters

This macro has no parameters


Return value

BYTE


Simulation macro reference

This component does not contain any simulation macros


Property reference

Address

This property is of type Fixed list of ints and can be referenced with the variable name Addr.

Selects the correct device address based on the ADDR pin connection to VDD or VSS.

Channel

This property is of type Fixed list of ints and can be referenced with the variable name cal_i2c1::CHANNEL.

Channel selection

SDA

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)

SCL

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)

Baud Select

This property is of type Fixed list of ints and can be referenced with the variable name cal_i2c1::BAUD_LIST.

Baud rate option selector

Baud Rate

This property is of type Signed integer and can be referenced with the variable name cal_i2c1::BAUD.

Baud rate to be used

Stop Delay

This property is of type True or false and can be referenced with the variable name cal_i2c1::StopDel.

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 Type

This property is of type Fixed list of ints and can be referenced with the variable name SimType.

No additional information


Scope Traces

This property is of type True or false and can be referenced with the variable name cal_i2c1::ScopeTraces.

Selects if the component pin connections are automatically generated on the data recorder window or not.

Yes: Automatically add the component pins to a group on the data recorder which will reflect the sim data during simultion.

No: Do not show the pin signals on the data recorder window.

Console Data

This property is of type True or false and can be referenced with the variable name cal_i2c1::ConsoleData.

Selects if the console data is automatically generated or not

Injector

This property is of type Fixed list of ints and can be referenced with the variable name cal_i2c1::Injector.

No additional information