Hi,
I've read a previous thread regarding using the AXDL345's interrupt pin PIN1 to trigger the Arduino's INT0.
I have the connected and loaded the script posted before, but I can seem to get it work.
So basically the connection is:
ADXL345 UNO
SDA ---- A5
SCL ---- A4
INT1 ---- D2 (INT0)
When I measure the voltage on coming out of ADXL345's INT1, it's changing to 3V when I nudge the device. So yeah, it looks like the ADXL is doing something, but why isnt the Arduino processing it correctly. The attachinterrupt doesnt seem to do anything. The ISR wasn't invoked.
I appreciate your help!
#include <Ad345.h>
#include <Wire.h>
adxl345 accel;
int acc[2];
void setup()
{
Wire.begin();
Serial.begin(9600);
accel.initBasic();
attachInterrupt(0,sample,RISING);
accel.getValues(acc);
}
void loop()
{
}
void sample()
{
accel.getValues(acc);
Serial.println("it works");
}