26 #include <Adafruit_I2CDevice.h> 28 #define MPRLS_DEFAULT_ADDR (0x18) 29 #define MPRLS_READ_TIMEOUT (20) 30 #define MPRLS_STATUS_POWERED (0x40) 31 #define MPRLS_STATUS_BUSY (0x20) 32 #define MPRLS_STATUS_FAILED (0x04) 33 #define MPRLS_STATUS_MATHSAT (0x01) 34 #define COUNTS_224 (16777216L) 35 #define PSI_to_HPA (68.947572932) 36 #define MPRLS_STATUS_MASK \ 48 uint16_t PSI_min = 0, uint16_t PSI_max = 25,
49 float OUTPUT_min = 10,
float OUTPUT_max = 90,
60 Adafruit_I2CDevice *i2c_dev = NULL;
61 uint32_t readData(
void);
64 uint16_t _PSI_min, _PSI_max;
65 uint32_t _OUTPUT_min, _OUTPUT_max;
float readPressure(void)
Read and calculate the pressure.
Definition: Adafruit_MPRLS.cpp:126
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
Definition: Adafruit_MPRLS.cpp:72
Class that stores state and functions for interacting with MPRLS sensor IC.
Definition: Adafruit_MPRLS.h:45
uint8_t readStatus(void)
Read just the status byte, see datasheet for bit definitions.
Definition: Adafruit_MPRLS.cpp:192
uint8_t lastStatus
Definition: Adafruit_MPRLS.h:57
bool begin(uint8_t i2c_addr=MPRLS_DEFAULT_ADDR, TwoWire *twoWire=&Wire)
setup and initialize communication with the hardware
Definition: Adafruit_MPRLS.cpp:94
#define PSI_to_HPA
Constant: PSI to HPA conversion factor.
Definition: Adafruit_MPRLS.h:35
#define MPRLS_DEFAULT_ADDR
Most common I2C address.
Definition: Adafruit_MPRLS.h:28