I'm having a problem figuring out how to measure my acceleration using the adxl320. It's a 2 axis accelerometer. I've got it working just fine --assuming that it's starting position is lying flat. The problem is that it's going to be mounted on something different each time and the starting position will not necessarily be horizontal or perpendicular to earth, which means my 1G reading wont be the same (512) each time. I'm looking for some ideas or a kicking off point, on how to measure no movement and then to calculate acceleration, if the device is mounted in a different plane (as compared to earth) each time.
My initial thought is to take readings for 10-15 seconds, when I know i'll be stationary, and average those to get what will be assumed as no motion. Place this in a variable and then start calculating deviations from that point. The problem is, what if the device stops and is on an incline. It will assume that there's movement. I dont know......maybe it's right in front of me and I'm looking harder than I need to.
ALL SUGGESTIONS ARE WELCOMED AND APPRECIATED.