Measuring three axis acceleration with a digital accelerometer