Adafruit LIS331 Arduino Driver
Adafruit_LIS331HH.h
Go to the documentation of this file.
1 
21 #ifndef ADAFRUIT_LIS331HH_H
22 #define ADAFRUIT_LIS331HH_H
23 
24 #include "Adafruit_LIS331.h"
25 
27 #define LIS331HH_DEFAULT_ADDRESS (0x18) // if SDO/SA0 is 3V, its 0x19
28 
30 typedef enum {
35 
41 public:
43 
44  bool begin_I2C(uint8_t i2c_addr = LIS331_DEFAULT_ADDRESS,
45  TwoWire *wire = &Wire, int32_t sensorID = 0);
46 
47  bool begin_SPI(uint8_t cs_pin, SPIClass *theSPI = &SPI,
48  int32_t sensor_id = 0);
49  bool begin_SPI(int8_t cs_pin, int8_t sck_pin, int8_t miso_pin,
50  int8_t mosi_pin, int32_t sensor_id = 0);
51 
52  void setRange(lis331hh_range_t range);
54 
55 private:
56  bool _init(int32_t sensor_id);
57  void _scaleValues(void);
58 };
59 
60 #endif
Adafruit_LIS331HH()
Instantiates a new H3LIS331 class in I2C.
Definition: Adafruit_LIS331HH.cpp:13
+/- 24Gvalue)
Definition: Adafruit_LIS331HH.h:33
+/- 6G
Definition: Adafruit_LIS331HH.h:31
bool begin_I2C(uint8_t i2c_addr=LIS331_DEFAULT_ADDRESS, TwoWire *wire=&Wire, int32_t sensorID=0)
Sets up the hardware and initializes I2C.
Definition: Adafruit_LIS331HH.cpp:25
#define LIS331_DEFAULT_ADDRESS
Definition: Adafruit_LIS331.h:49
lis331hh_range_t getRange(void)
Gets the measurement range for the H3LIS331.
Definition: Adafruit_LIS331HH.cpp:156
Class that stores state and functions for interacting with Adafruit_LIS331HH.
Definition: Adafruit_LIS331HH.h:40
+/- 12G
Definition: Adafruit_LIS331HH.h:32
Class that stores state and functions for interacting with Adafruit_LIS331.
Definition: Adafruit_LIS331.h:131
lis331hh_range_t
Definition: Adafruit_LIS331HH.h:30
bool begin_SPI(uint8_t cs_pin, SPIClass *theSPI=&SPI, int32_t sensor_id=0)
Sets up the hardware and initializes hardware SPI.
Definition: Adafruit_LIS331HH.cpp:48
void setRange(lis331hh_range_t range)
Sets the measurement range for the H3LIS331.
Definition: Adafruit_LIS331HH.cpp:148