@OP,the generic 'trick' is to sum the range of the values, and subtract the new value.

In your example, the range is -10 to +10, so -10 +10=0.

Now, say your accelerometer gives you -5.

0 - (-5) = 5.

Say it gives +3.

0 - 3 = 3.

Very simple arithmetic.