Hi,
How can I generate a hardware interrupt from the SparkFun Triple Axis Accelerometer Breakout board.
My starting point is the Spakrfun_ADXL345_example.ino which is included in the Arduino library for this product.
This example implies that it demonstrates such a technique - the ADXL345 generates an interrupt on INT1 pin which is then detected by the Arduino and serviced by the ADXL_ISR() routine - once the relevant REMs are removed for the sketch, that is.
However, as this post implies, I can not get this to work. This is the debug testing I have done so far:
Replaced the INT1 input with a switch and added a volatile flag to the ADXL_ISR() routine to test that the Arduinio is detecting and servicing the attachInterrupt(). Which it is.
Scoped the INT1 output pin. No activity.
Read the getInterruptSource() (which the example program does via polling) and interrupt conditions are being met within the ADXL345 chip.
My conclusion so far is that there must be an internal register that the Sparkfun library is not exposing that will enable the internally generated interrupt to be routed to the INT1 pin? Looking at the source, I see several references to “isInerruptEnabled()” that do not seem to be functioning? However my programming skills fall far short of being able to understand all that is happening (or in my case - not happening).
Searching this forum, I see what looks like a similar issue posed back in 2012. But that does not seem to have been concluded with any success?
Best regards, and looking forward to any suggestions, Martin