On Sat, Jun 16, 2012 at 4:10 AM, Electron wrote: > On a 3-axial accelerator I compute the magnitude by simple Pythagorean th= eorem > in 3D, i.e. Mag=3Dsqrt(AccX*AccX+AccY*AccY+AccZ*AccZ) > > It is an analogue accelerometer with significant RC filters between its 3= analog > outputs and the PIC ADC. What is the range of your AccX, AccY and AccZ values? What value gives you zero g? What value gives you 1g? If you are using A/D counts, 0 to 1023, then you need to use an integer data type and subtract 512 so that for an acceleration of zero you have an input of zero. -- Martin K. --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .