So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By parijip
#84702 Thanks for your reply. That was indeed a mistake. I changed it to & and as per the following definition:
#define ADXL345_INT_DATA_READY_BIT 7
#define ADXL345_INT_SINGLE_TAP_BIT 6
#define ADXL345_INT_DOUBLE_TAP_BIT 5
#define ADXL345_INT_ACTIVITY_BIT 4
#define ADXL345_INT_INACTIVITY_BIT 3
#define ADXL345_INT_FREE_FALL_BIT 2
#define ADXL345_INT_WATERMARK_BIT 1
#define ADXL345_INT_OVERRUN_BIT 0

it works as expected - when reading from the loop().

However, the issue of interrupt not firing still remains. So, I did the following:
Connected the INT1 pin to A0 on ESP8266 via a jumper wire - and kept printing analogRead(A0). To my surprise, the voltage level remains between 0-10 all the time - never coming anywhere close to 1024.
This behavior remains so - even if I change the INT_INVERT bit to 1 in the DATA_FORMAT register using the adxl.setInterruptLevel(1) to make the interrupt active low or vice-versa.

Looks like, therefore, I have a faulty breakout board - with the interrupt pins not properly connected.
User avatar
By Anttiduino
#84720 Can you test the interrupt by connecting INT1-pin of ESP8266 to Vcc/GND using a jumper wire?

Add a LED blink to the interrupt handler to see if really anything happens there:

Code: Select alldigitalWrite(LED_pin,!(digitalRead(LED_pin)));  // Toggle LED Pin


Remember to define the LED_pin of your development board. And also define that pin as output:

Code: Select allpinMode(LED_pin, OUTPUT);