Skip to content

Commit b75b405

Browse files
committed
added int pin toggling
1 parent 20c94be commit b75b405

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
*.swo
33
.DS_Store
44
.vscode
5+
Doxyfile
6+
html/

Adafruit_LSM303_Accel.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,4 +334,19 @@ uint8_t Adafruit_LSM303_Accel_Unified::getShift(lsm303_accel_mode_t mode) {
334334
}
335335

336336
return shift;
337+
}
338+
339+
/*************************************************************************/
340+
/*!
341+
@brief Sets the polarity of the interrupt pins
342+
@param active_high Set to true for the INT pints to be active high,
343+
false for active low
344+
*/
345+
void Adafruit_LSM303_Accel_Unified::interruptsActiveHigh(bool active_high) {
346+
Adafruit_BusIO_Register ctrl_6 =
347+
Adafruit_BusIO_Register(i2c_dev, LSM303_REGISTER_ACCEL_CTRL_REG6_A);
348+
Adafruit_BusIO_RegisterBits active_low_bit =
349+
Adafruit_BusIO_RegisterBits(&ctrl_6, 1, 1);
350+
351+
active_low_bit.write(active_high);
337352
}

Adafruit_LSM303_Accel.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ class Adafruit_LSM303_Accel_Unified : public Adafruit_Sensor {
118118
lsm303_accel_mode_t getMode(void);
119119
void setMode(lsm303_accel_mode_t);
120120

121+
void interruptsActiveHigh(bool);
122+
121123
private:
122124
int32_t _sensorID;
123125

0 commit comments

Comments
 (0)