I have recently been playing around with a MMA8452Q triple axis accelerometer from proto-pic. My basic premise was to set up 2 accelerometers and get them to send an interrupt when the acceleration was greater than 1g in any axis. I wanted to set them side-by-side and measure the time difference between the interrupts on an oscilloscope for a common 1g impulse shock, in my case I hoped it was very small. I managed to set the devices up on a 800Hz sample rate, 1g transient shock threshold and no debounce counter. Unfortunately for my application the time difference between the interrupts from both devices for the same impulse shock was too long (up to 1.5ms) so I need to rethink my original idea. Attached is my code as an example start for anyone else wishing to setup the accelerometers. Bare in mind my code is quick and dirty and worked for me but hopefully helpful. I used a Netduino Plus 2 on framework 4.3
For reference to understand the MMA8452Q useful Freescale info can be found:
Thank you to Stefan Thoolen for the netmftoolbox. I used the MultiI2C class and extended it slightly to help reading and writing to individual registers. I used individual toolbox cs files rather than referencing the whole toolbox hence the inclusion of Tools.cs and MultiI2C.cs .