Determining accleration due to gravity

wwbrown:
How about a magnetometer if you only want to measure the direction of the acceleration due to gravity. I am pretty sure that a magnetometer will not be affected by linear or rotational acceleration.

Is that a magnetic sensor? It can only measure your angle to local magnetic field, not your angle to local gravity. Facing north while tilting up 30 degrees and facing south while tilting down 30 degrees will read the same on a magnetic sensor.