#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.