Component: Temp Humidity (HTS221) (Sensors)

From Flowcode Help
Jump to navigationJump to search


Author Matrix TSL
Version 1.0 (Release)
Category Sensors


Image Temp Humidity (HTS221) component

A temperature and relative humidity sensor allowing the ambient temperature and relative humidity to be monitored digitally. Humidity Range = 0% - 100% +/- 3.5% Temperature Range = -40 - 120 Degrees C +/- 0.5 Degrees C

Examples

No additional examples


Downloadable macro reference

ReadHumidityInt

Samples the humidity from the sensor and returns the relative humidity reading as a integer byte from 0 to 100

Parameters

This macro has no parameters


Return value

BYTE


DataAvailable

Checks to see if new sensor data is available.

Returns 0 if no new data is available.

Returns 1 if new Temperature data is available.

Returns 2 if new Humidity data is available.

Returns 3 if new Temp and Humidity data is available.

Parameters

This macro has no parameters


Return value

BYTE


ControlHeater

Controls the in-built heater element to speed up sensor recovery time in case of condensation. Humidity and temperature cannot be read while Heater is active.

Parameters

BOOL Active
0 = Off (Sensor Reading Available) / 1 = On (Sensor Reading Disabled)


Return value

This call does not return a value


ReadTemperatureInt

Samples the temperature from the sensor and returns the reading in degrees C as an integer from -40 to 120.

Parameters

This macro has no parameters


Return value

INT


ReadHumidityReal

Samples the humidity from the sensor and returns the relative humidity reading as a float from 0.0 to 100.0.

Parameters

This macro has no parameters


Return value

FLOAT


ReadRegister

Reads an 8-bit value from one of the registers onboard the sensor IC.

Parameters

BYTE Address


Return value

BYTE


ReadTemperatureReal

Samples the temperature from the sensor and returns the reading in degrees C as a float from -40.0 to 120.0.

Parameters

This macro has no parameters


Return value

FLOAT


WriteRegister

Writes a value to a register on the sensor IC.

Parameters

BYTE Address
BYTE Value


Return value

This call does not return a value


Initialise

Configures the I2C peripheral ready for communications.

Parameters

This macro has no parameters


Return value

This call does not return a value


Simulation macro reference

This component does not contain any simulation macros


Property reference

Data Rate

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

No additional information


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)

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.

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

Sim 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