Class that stores state and functions for interacting with MPRLS sensor IC.
More...
#include <Adafruit_MPRLS.h>
|
| Adafruit_MPRLS (int8_t reset_pin=-1, int8_t EOC_pin=-1, uint16_t PSI_min=0, uint16_t PSI_max=25, float OUTPUT_min=10, float OUTPUT_max=90, float K=PSI_to_HPA) |
| constructor initializes default configuration value More...
|
|
bool | begin (uint8_t i2c_addr=MPRLS_DEFAULT_ADDR, TwoWire *twoWire=&Wire) |
| setup and initialize communication with the hardware More...
|
|
uint8_t | readStatus (void) |
| Read just the status byte, see datasheet for bit definitions. More...
|
|
float | readPressure (void) |
| Read and calculate the pressure. More...
|
|
Class that stores state and functions for interacting with MPRLS sensor IC.
◆ Adafruit_MPRLS()
Adafruit_MPRLS::Adafruit_MPRLS |
( |
int8_t |
reset_pin = -1 , |
|
|
int8_t |
EOC_pin = -1 , |
|
|
uint16_t |
PSI_min = 0 , |
|
|
uint16_t |
PSI_max = 25 , |
|
|
float |
OUTPUT_min = 10 , |
|
|
float |
OUTPUT_max = 90 , |
|
|
float |
K = PSI_to_HPA |
|
) |
| |
constructor initializes default configuration value
- Parameters
-
reset_pin | Optional hardware reset pin, default set to -1 to skip |
EOC_pin | Optional End-of-Convert indication pin, default set to -1 to skip |
PSI_min | The minimum PSI measurement range of the sensor, default 0 |
PSI_max | The maximum PSI measurement range of the sensor, default 25 |
OUTPUT_min | The minimum transfer function curve value in %, default 10% |
OUTPUT_max | The maximum transfer function curve value in %, default 90% |
K | Conversion Factor to desired units, default is PSI to HPA |
◆ begin()
boolean Adafruit_MPRLS::begin |
( |
uint8_t |
i2c_addr = MPRLS_DEFAULT_ADDR , |
|
|
TwoWire * |
twoWire = &Wire |
|
) |
| |
setup and initialize communication with the hardware
- Parameters
-
i2c_addr | The I2C address for the sensor (default is 0x18) |
twoWire | Optional pointer to the desired TwoWire I2C object. Defaults to &Wire |
- Returns
- True on success, False if sensor not found
◆ readStatus()
uint8_t Adafruit_MPRLS::readStatus |
( |
void |
| ) |
|
Read just the status byte, see datasheet for bit definitions.
- Returns
- 8 bits of status data
◆ readPressure()
float Adafruit_MPRLS::readPressure |
( |
void |
| ) |
|
Read and calculate the pressure.
- Returns
- The measured pressure, in hPa on success, NAN on failure
◆ lastStatus
uint8_t Adafruit_MPRLS::lastStatus |
status byte after last operation
The documentation for this class was generated from the following files: