Class that stores state and functions for interacting with the TMP117 High-Accuracy Temperature Sensor.
More...
#include <Adafruit_TMP117.h>
Class that stores state and functions for interacting with the TMP117 High-Accuracy Temperature Sensor.
◆ begin()
bool Adafruit_TMP117::begin |
( |
uint8_t |
i2c_address = TMP117_I2CADDR_DEFAULT , |
|
|
TwoWire * |
wire = &Wire , |
|
|
int32_t |
sensor_id = 117 |
|
) |
| |
Sets up the hardware and initializes I2C.
- Parameters
-
i2c_address | The I2C address to be used. |
wire | The Wire object to be used for I2C connections. |
sensor_id | The unique ID to differentiate the sensors from others |
- Returns
- True if initialization was successful, otherwise false.
◆ interruptsActiveLow() [1/2]
void Adafruit_TMP117::interruptsActiveLow |
( |
bool |
active_low | ) |
|
Sets the polarity of the INT pin.
- Parameters
-
active_low | Set to true to make the pin active low |
◆ interruptsActiveLow() [2/2]
bool Adafruit_TMP117::interruptsActiveLow |
( |
void |
| ) |
|
Get the polarity of the INT pin.
- Returns
- active_low
true: INT pin is active when low false: INT pin is active when high
◆ getEvent()
bool Adafruit_TMP117::getEvent |
( |
sensors_event_t * |
temp | ) |
|
Gets the pressure sensor and temperature values as sensor events.
- Parameters
-
temp | Sensor event object that will be populated with temp data |
- Returns
- True
◆ getAlerts()
Get the current state of the alert flags.
NOTE: Because the high/low temperature status is based on temperature data, their status returned by this method is only updated when new temperature data is available. This ensures that the reported value is based on temperature data and not a cleared but not updated alert status.
- Parameters
-
alerts | Pointer to an alerts struct to be filled with the trigger status of the alerts |
- Returns
- true:success false: failure
◆ thermAlertModeEnabled() [1/2]
bool Adafruit_TMP117::thermAlertModeEnabled |
( |
bool |
therm_enabled | ) |
|
Enable or disable "THERM" alert mode.
WHen enabled, the 'low' alert will never trigger and acts in combination with the high threshold to determine the behavior of the high temperature alert.
In "Therm" mode, the "high" temperature alert statys triggered until the measured temperature goes below the 'low' temperature threshold, allowing it to act like a hysteresis value to prevent thrashing around the threshold temperature.
- Parameters
-
- Returns
- true:success false:failure
◆ thermAlertModeEnabled() [2/2]
bool Adafruit_TMP117::thermAlertModeEnabled |
( |
void |
| ) |
|
Get the current enable status of the "THERM" alert mode.
- Returns
- true: Therm mode enabled
-
false Normal high/low alert mode enabled
◆ getAveragedSampleCount()
Read the current number of samples that are averaged to calculate the reported temperature.
- Returns
- tmp117_average_count_t The current average setting enum value
◆ setAveragedSampleCount()
Set the number of raw measurements that are averaged into the reported temperature.
Each sample read takes 15.5ms so the higher the number of averaged samples, the longer the amount of time between new measurements. For larger average counts the amount of time required for a new measurement will exceed the interval specified by setReadDelay
- Parameters
-
count | The tmp117_average_count_t that specifies the desired sample count |
- Returns
- true:success false:failure
◆ getOffset()
float Adafruit_TMP117::getOffset |
( |
void |
| ) |
|
Read the current temperature offset.
- Returns
- float The currently set temperature offset.
◆ setOffset()
bool Adafruit_TMP117::setOffset |
( |
float |
offset | ) |
|
Write a new temperature offset.
- Parameters
-
offset | The new temperature offset in degrees C. When set, the given offset will be added to all future temperature reads reported by getEvent |
- Returns
- true: success false: failure
◆ getLowThreshold()
float Adafruit_TMP117::getLowThreshold |
( |
void |
| ) |
|
Read the current low temperature threshold.
- Returns
- float The current low temperature threshold in degrees C
◆ setLowThreshold()
bool Adafruit_TMP117::setLowThreshold |
( |
float |
low_threshold | ) |
|
Set a new low temperature threshold.
- Parameters
-
low_threshold | The new threshold to be set, in degrees C. An alert will trigger when the current temperature measurement is lower than the given threshold. |
- Returns
- true:success false: failure
◆ getHighThreshold()
float Adafruit_TMP117::getHighThreshold |
( |
void |
| ) |
|
Read the current high temperature threshold.
- Returns
- float The current high temperature threshold in degrees C
◆ setHighThreshold()
bool Adafruit_TMP117::setHighThreshold |
( |
float |
high_threshold | ) |
|
Set a new high temperature threshold.
- Parameters
-
high_threshold | The new threshold to be set, in degrees C. An alert will trigger when the current temperature measurement is higher than the given threshold. |
- Returns
- true:success false: failure
◆ getReadDelay()
Get current setting for the minimum delay between calculated temperature reads.
- Returns
- tmp117_delay_t The minimum time between new temperature measurements. This amount of time will be exceeded if the time required for the configured number of averaged reads is more than the delay setting.
◆ setReadDelay()
Set a new minimum delay between calculated reads.
- Parameters
-
delay | The minimum time between new temperature measurements as a tmp117_delay_t . This amount of time will be exceeded if the time required for the configured number of averaged reads is more than the delay setting. |
- Returns
- true:success false:failure
◆ getMeasurementMode()
Read the active measurement mode.
- Returns
- tmp117_mode_t The current measurement mode.
◆ setMeasurementMode()
Set a new measurement mode.
- Parameters
-
mode | the new mode to set, a tmp117_mode_t . If mode is TMP117_MODE_ONE_SHOT , initiate a new reading before switching to TMP117_MODE_SHUTDOWN . |
- Returns
- true:success false:failure
The documentation for this class was generated from the following files: