Difference between revisions of "Component: Temp / Humidity (HTS221) (Environmental)"
From Flowcode Help
Jump to navigationJump to search (Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix TSL |- | width="20%" style="color:gray;" | Version | 1.0 |- | width="20%" style="color:gray...") |
|||
| Line 16: | Line 16: | ||
==Detailed description== | ==Detailed description== | ||
| + | |||
| + | |||
''No detailed description exists yet for this component'' | ''No detailed description exists yet for this component'' | ||
==Examples== | ==Examples== | ||
| + | |||
| + | |||
| Line 590: | Line 594: | ||
|- | |- | ||
| colspan="2" | Initialise the comms to the Arduino board ready for commands to be sent. | | colspan="2" | Initialise the comms to the Arduino board ready for commands to be sent. | ||
| + | |- | ||
| + | |- | ||
| + | | 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'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| 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;" | '''PWMEnable''' | ||
| + | |- | ||
| + | | colspan="2" | Allows pulse width modulated transistor outputs to be switched on or off. Bit 0 = Enable AB Bit 1 = A / Bit 2 = B Bit 3 = C / Bit 4 = D Bit 5 = Enable CD | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | EnableMask | ||
| + | |- | ||
| + | | colspan="2" | Range 0-63 or 0b00000 to 0b111111 | ||
| + | |- | ||
| + | | 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'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| 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" | | ||
|- | |- | ||
|- | |- | ||
Revision as of 10:39, 17 November 2021
| Author | Matrix TSL |
| Version | 1.0 |
| Category | Environmental |
Contents
Temp / Humidity 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
Detailed description
No detailed description exists yet for this component
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 | |
| Return | |
| ReadTemperatureInt | |
| Samples the temperature from the sensor and returns the reading in degrees C as an integer from -40 to 120. | |
| [[File:]] - | Return |
| ReadHumidityReal | |
| Samples the humidity from the sensor and returns the relative humidity reading as a float from 0.0 to 100.0. | |
| [[File:]] - | Return |
| ReadRegister | |
| Reads an 8-bit value from one of the registers onboard the sensor IC. | |
| Address | |
| Return | |
| ReadTemperatureReal | |
| Samples the temperature from the sensor and returns the reading in degrees C as a float from -40.0 to 120.0. | |
| [[File:]] - | Return |
| WriteRegister | |
| Writes a value to a register on the sensor IC. | |
| Address | |
| Data | |
| Return | |
| Initialise | |
| Configures the I2C peripheral ready for communications. | |
| Return | |
| Initialise | |
| Initialises the component ready for I2C communications | |
| Return | |
| Initialise | |
| Sets up up the communication bus and initialises the accelerometer module. Returns 0 for success and > 0 for fail. | |
| Return | |
| SimSetGyro | |
| Allows the XYZ slider values to be set via the simulation | |
| [[File:]] - | X |
| [[File:]] - | Y |
| [[File:]] - | Z |
| Return | |
| UpdateAccelerometerData | |
| Reads from the accelerometer and updates the local XYZ variables. Returns 1 for new data and 0 for no new data | |
| Return | |
| SimSetCompass | |
| Allows the XYZ slider values to be set via the simulation | |
| [[File:]] - | X |
| [[File:]] - | Y |
| [[File:]] - | Z |
| Return | |
| Initialise | |
| Sets up up the communication bus and initialises the accelerometer module. Returns 0 for success and > 0 for fail. | |
| Return | |
| IOSetOutputPin | |
| Sets the selected digital pin to an output and assigns the output state. | |
| Pin | |
| Range: 0-29 | |
| [[File:]] - | State |
| Range: 0-1 | |
| Return | |
| UARTReceive | |
| Receives a data byte from the UART. Recommend calling the UARTCheckRx function first to ensure data is available. | |
| Channel | |
| Channel Index: Range 0 - UART Bus Count - 1 | |
| Return | |
| OneWireScanBus | |
| Scans the one wire bus to detect all connected devices. Returns the number of one wire devices found. | |
| Channel | |
| Channel Index: Range 0 - I2C Bus Count - 1 | |
| Return | |
| SPIInitialise | |
| Initialsie the SPI module ready for communications | |
| Channel | |
| Channel Index: Range 0 - SPI Bus Count - 1 | |
| Return | |
| OneWireReceiveByte | |
| Receives a byte from the one wire bus a bit at a time | |
| Channel | |
| Channel Index: Range 0 - I2C Bus Count - 1 | |
| Return | |
| I2CSend | |
| Transmit a byte using the I2C bus | |
| Channel | |
| Channel Index: Range 0 - I2C Bus Count - 1 | |
| DataOut | |
| [[File:]] - | Return |
| UARTSend | |
| Send a byte via the UART module | |
| Channel | |
| Channel Index: Range 0 - UART Bus Count - 1 | |
| Data | |
| Data Byte to send. Range: 0-255 | |
| Return | |
| OneWireGetDeviceCount | |
| Returns the number of devices found by the last ScanBus operation. | |
| Channel | |
| Channel Index: Range 0 - I2C Bus Count - 1 | |
| Return | |
| PWMSetPrescaler | |
| Sets the prescaler for the PWM output | |
| Channel | |
| Range: 0 - 11 | |
| Prescaler | |
| Period | |
| Return | |
| PWMEnable | |
| Enable a PWM output | |
| Channel | |
| Range: 0-11 | |
| Return | |
| Initialise | |
| Initialise the comms to the Arduino board ready for commands to be sent. | |
| Return | |
| Initialise | |
| Return | |