Hi, can you explain me how enable XYZ Motion detection interrupt INT2? it is for alarm school project.
Thanks
Hi @zzzap,
Here is an example on how to use the interrupt on our SFF board.
https://support.sodaq.com/Boards/Sara_SFF/examples/LSM303AGR/
If you have any questions let me know!
Best regards,
Jan
Thank you for your answer. Your example is for the INT1 pin and only for the Z axis. If I use the INT2 pin is it the same? If I want to detect movement in all XYZ axes (above and below the threshold). Thanks for your help.
PS… the arduino must blink a led when interrupt is generated by motion
Hi @zzzap,
The example shows only one axis indeed.
// If Z goes below threshold the interrupt is triggered
AccMeter.enableInterrupt1(AccMeter.ZLow, threshold, 0, AccMeter.PositionRecognition);
To enable all axis you can change it to:
AccMeter.enableInterrupt1(AccMeter.XLow | AccMeter.XHigh | AccMeter.YLow | AccMeter.YHigh |
AccMeter.ZLow | AccMeter.ZHigh, threshold, 0, AccMeter.PositionRecognition);
Best regards,
Jan