Adafruit MS8607 Library
|
#include <Adafruit_MS8607.h>
Public Member Functions | |
Adafruit_MS8607 (void) | |
Instantiates a new MS8607 class. | |
bool | begin (TwoWire *wire=&Wire, int32_t sensor_id=0) |
Sets up the hardware and initializes I2C. More... | |
bool | init (int32_t sensor_id) |
Initializer for post i2c/spi init. More... | |
bool | reset (void) |
Reset the sensors to their initial state. More... | |
ms8607_humidity_resolution_t | getHumidityResolution (void) |
Get the currently set resolution for humidity readings. More... | |
bool | setHumidityResolution (ms8607_humidity_resolution_t res) |
Set the resolution for humidity readings. More... | |
ms8607_pressure_resolution_t | getPressureResolution (void) |
Get the currently set resolution for pressure readings. More... | |
bool | setPressureResolution (ms8607_pressure_resolution_t res) |
Set the resolution for pressure readings. More... | |
bool | enableHumidityClockStretching (bool enable_stretching) |
Allow the MS8607 to hold the clock line low until it completes the requested measurements. More... | |
bool | getEvent (sensors_event_t *pressure, sensors_event_t *temp, sensors_event_t *humidity) |
Gets the humidity sensor and temperature values as sensor events. More... | |
Adafruit_Sensor * | getTemperatureSensor (void) |
Gets the Adafruit_Sensor object for the MS0607's temperature sensor. More... | |
Adafruit_Sensor * | getPressureSensor (void) |
Gets the Adafruit_Sensor object for the MS0607's pressure sensor. More... | |
Adafruit_Sensor * | getHumiditySensor (void) |
Gets the Adafruit_Sensor object for the MS0607's humidity sensor. More... | |
Protected Attributes | |
uint16_t | _sensorid_temp |
ID number for temperature. | |
uint16_t | _sensorid_pressure |
ID number for pressure. | |
uint16_t | _sensorid_humidity |
ID number for humidity. | |
Adafruit_I2CDevice * | pt_i2c_dev = NULL |
Adafruit_I2CDevice * | hum_i2c_dev |
Pointer to I2C bus interface for the humidity sensor. More... | |
Adafruit_MS8607_Temp * | temp_sensor = NULL |
Temp sensor data object. | |
Adafruit_MS8607_Pressure * | pressure_sensor |
Pressure sensor data object. More... | |
Adafruit_MS8607_Humidity * | humidity_sensor |
Humidity sensor data object. More... | |
Friends | |
class | Adafruit_MS8607_Temp |
class | Adafruit_MS8607_Pressure |
class | Adafruit_MS8607_Humidity |
Driver for the Adafruit MS8607 PHT sensor.
bool Adafruit_MS8607::begin | ( | TwoWire * | wire = &Wire , |
int32_t | sensor_id = 0 |
||
) |
Sets up the hardware and initializes I2C.
wire | The Wire object to be used for I2C connections. |
sensor_id | The unique ID to differentiate the sensors from others |
bool Adafruit_MS8607::init | ( | int32_t | sensor_id | ) |
Initializer for post i2c/spi init.
sensor_id | Optional unique ID for the sensor set |
bool Adafruit_MS8607::reset | ( | void | ) |
Reset the sensors to their initial state.
ms8607_humidity_resolution_t Adafruit_MS8607::getHumidityResolution | ( | void | ) |
Get the currently set resolution for humidity readings.
bool Adafruit_MS8607::setHumidityResolution | ( | ms8607_humidity_resolution_t | resolution | ) |
Set the resolution for humidity readings.
resolution | The new resolution to set |
ms8607_pressure_resolution_t Adafruit_MS8607::getPressureResolution | ( | void | ) |
Get the currently set resolution for pressure readings.
bool Adafruit_MS8607::setPressureResolution | ( | ms8607_pressure_resolution_t | resolution | ) |
Set the resolution for pressure readings.
resolution | The new resolution to set |
bool Adafruit_MS8607::enableHumidityClockStretching | ( | bool | enable_stretching | ) |
Allow the MS8607 to hold the clock line low until it completes the requested measurements.
enable_stretching | true: enable |
bool Adafruit_MS8607::getEvent | ( | sensors_event_t * | pressure, |
sensors_event_t * | temp, | ||
sensors_event_t * | humidity | ||
) |
Gets the humidity sensor and temperature values as sensor events.
pressure | Sensor event object that will be populated with pressure data |
temp | Sensor event object that will be populated with temp data |
humidity | Sensor event object that will be populated with humidity data |
Adafruit_Sensor * Adafruit_MS8607::getTemperatureSensor | ( | void | ) |
Gets the Adafruit_Sensor object for the MS0607's temperature sensor.
Adafruit_Sensor * Adafruit_MS8607::getPressureSensor | ( | void | ) |
Gets the Adafruit_Sensor object for the MS0607's pressure sensor.
Adafruit_Sensor * Adafruit_MS8607::getHumiditySensor | ( | void | ) |
Gets the Adafruit_Sensor object for the MS0607's humidity sensor.
|
friend |
Gives access to private members to Temperature data object
|
friend |
Gives access to private members to Pressure data object
|
friend |
Gives access to private members to Humidity data object
|
protected |
Pointer to I2C bus interface for the pressure & temperature sensor
|
protected |
Pointer to I2C bus interface for the humidity sensor.
|
protected |
Pressure sensor data object.
|
protected |
Humidity sensor data object.