15 #include <Adafruit_BusIO_Register.h> 16 #include <Adafruit_I2CDevice.h> 17 #include <Adafruit_Sensor.h> 20 #define LSM303_ADDRESS_ACCEL (0x32 >> 1) 26 LSM303_REGISTER_ACCEL_WHO_AM_I = 0x0F,
27 LSM303_REGISTER_ACCEL_CTRL_REG1_A = 0x20,
28 LSM303_REGISTER_ACCEL_CTRL_REG2_A = 0x21,
29 LSM303_REGISTER_ACCEL_CTRL_REG3_A = 0x22,
30 LSM303_REGISTER_ACCEL_CTRL_REG4_A = 0x23,
31 LSM303_REGISTER_ACCEL_CTRL_REG5_A = 0x24,
32 LSM303_REGISTER_ACCEL_CTRL_REG6_A = 0x25,
33 LSM303_REGISTER_ACCEL_REFERENCE_A = 0x26,
34 LSM303_REGISTER_ACCEL_STATUS_REG_A = 0x27,
35 LSM303_REGISTER_ACCEL_OUT_X_L_A = 0x28,
36 LSM303_REGISTER_ACCEL_OUT_X_H_A = 0x29,
37 LSM303_REGISTER_ACCEL_OUT_Y_L_A = 0x2A,
38 LSM303_REGISTER_ACCEL_OUT_Y_H_A = 0x2B,
39 LSM303_REGISTER_ACCEL_OUT_Z_L_A = 0x2C,
40 LSM303_REGISTER_ACCEL_OUT_Z_H_A = 0x2D,
41 LSM303_REGISTER_ACCEL_FIFO_CTRL_REG_A = 0x2E,
42 LSM303_REGISTER_ACCEL_FIFO_SRC_REG_A = 0x2F,
43 LSM303_REGISTER_ACCEL_INT1_CFG_A = 0x30,
44 LSM303_REGISTER_ACCEL_INT1_SOURCE_A = 0x31,
45 LSM303_REGISTER_ACCEL_INT1_THS_A = 0x32,
46 LSM303_REGISTER_ACCEL_INT1_DURATION_A = 0x33,
47 LSM303_REGISTER_ACCEL_INT2_CFG_A = 0x34,
48 LSM303_REGISTER_ACCEL_INT2_SOURCE_A = 0x35,
49 LSM303_REGISTER_ACCEL_INT2_THS_A = 0x36,
50 LSM303_REGISTER_ACCEL_INT2_DURATION_A = 0x37,
51 LSM303_REGISTER_ACCEL_CLICK_CFG_A = 0x38,
52 LSM303_REGISTER_ACCEL_CLICK_SRC_A = 0x39,
53 LSM303_REGISTER_ACCEL_CLICK_THS_A = 0x3A,
54 LSM303_REGISTER_ACCEL_TIME_LIMIT_A = 0x3B,
55 LSM303_REGISTER_ACCEL_TIME_LATENCY_A = 0x3C,
56 LSM303_REGISTER_ACCEL_TIME_WINDOW_A = 0x3D
93 #define LSM303_ID (0b11010100) 103 bool getEvent(sensors_event_t *);
104 void getSensor(sensor_t *);
112 void interruptsActiveHigh(
bool);
121 void readRawData(
void);
123 Adafruit_I2CDevice *i2c_dev;
High resolution mode; 12-bit.
Definition: Adafruit_LSM303_Accel.h:89
Measurement range from +2G to -2G (19.61 m/s^2)
Definition: Adafruit_LSM303_Accel.h:77
int16_t z
z-axis data
Definition: Adafruit_LSM303_Accel.h:69
int16_t x
x-axis data
Definition: Adafruit_LSM303_Accel.h:67
mode
Set of different modes that can be used. Normal, high resolution, and low power.
Definition: Adafruit_LSM303_Accel.h:87
Measurement range from +8G to -8G (78.45 m/s^2)
Definition: Adafruit_LSM303_Accel.h:79
lsm303AccelRegisters_t
Registers.
Definition: Adafruit_LSM303_Accel.h:25
Normal measurement mode; 10-bit.
Definition: Adafruit_LSM303_Accel.h:88
Measurement range from +16G to -16G (156.9 m/s^2)
Definition: Adafruit_LSM303_Accel.h:80
enum mode lsm303_accel_mode_t
Set of different modes that can be used. Normal, high resolution, and low power.
Low power mode; 8-bit.
Definition: Adafruit_LSM303_Accel.h:90
Unified sensor driver for the accelerometer.
Definition: Adafruit_LSM303_Accel.h:98
Measurement range from +4G to -4G (39.22 m/s^2)
Definition: Adafruit_LSM303_Accel.h:78
INTERNAL ACCELERATION DATA TYPE.
Definition: Adafruit_LSM303_Accel.h:66
struct lsm303AccelData_s lsm303AccelData
INTERNAL ACCELERATION DATA TYPE.
int16_t y
y-axis data
Definition: Adafruit_LSM303_Accel.h:68
range
Set of linear acceleration measurement ranges.
Definition: Adafruit_LSM303_Accel.h:76
#define LSM303_ADDRESS_ACCEL
I2C address/bits, 0011001x.
Definition: Adafruit_LSM303_Accel.h:20
enum range lsm303_accel_range_t
Set of linear acceleration measurement ranges.