Adafruit MPRLS Arduino Library
Adafruit_MPRLS.h
Go to the documentation of this file.
1 
20 #if (ARDUINO >= 100)
21 #include "Arduino.h"
22 #else
23 #include "WProgram.h"
24 #endif
25 #include "Wire.h"
26 
27 #define MPRLS_DEFAULT_ADDR (0x18)
28 #define MPRLS_STATUS_POWERED (0x40)
29 #define MPRLS_STATUS_BUSY (0x20)
30 #define MPRLS_STATUS_FAILED (0x04)
31 #define MPRLS_STATUS_MATHSAT (0x01)
32 
33 /**************************************************************************/
38 /**************************************************************************/
40 public:
41  Adafruit_MPRLS(int8_t reset_pin = -1, int8_t EOC_pin = -1,
42  uint8_t PSI_min = 0, uint8_t PSI_max = 25);
43 
44  boolean begin(uint8_t i2c_addr = MPRLS_DEFAULT_ADDR,
45  TwoWire *twoWire = &Wire);
46 
47  uint8_t readStatus(void);
48  float readPressure(void);
49 
50 private:
51  uint32_t readData(void);
52 
53  uint8_t _i2c_addr;
54  int8_t _reset, _eoc;
55  uint8_t _PSI_min, _PSI_max;
56 
57  TwoWire *_i2c;
58 };
float readPressure(void)
Read and calculate the pressure.
Definition: Adafruit_MPRLS.cpp:99
Class that stores state and functions for interacting with MPRLS sensor IC.
Definition: Adafruit_MPRLS.h:39
uint8_t readStatus(void)
Read just the status byte, see datasheet for bit definitions.
Definition: Adafruit_MPRLS.cpp:166
boolean begin(uint8_t i2c_addr=MPRLS_DEFAULT_ADDR, TwoWire *twoWire=&Wire)
setup and initialize communication with the hardware
Definition: Adafruit_MPRLS.cpp:68
#define MPRLS_DEFAULT_ADDR
Most common I2C address.
Definition: Adafruit_MPRLS.h:27
Adafruit_MPRLS(int8_t reset_pin=-1, int8_t EOC_pin=-1, uint8_t PSI_min=0, uint8_t PSI_max=25)
constructor initializes default configuration value
Definition: Adafruit_MPRLS.cpp:50