zero'ing a tilt sensor
This is really quite easy to achieve. What you need to do:

1) Ensure the operator places the sensor on the 0 degree shelf.

2) Measure the angle reading for the sensor from the 0 degree shelf.

3) Store away the reading in a safe place. Storage requirement will depend upon the system usage scenario. If the system can be zeroed every time it is powered up then it may be applicable to simply store the reading into a global memory variable. If the zeroing is only done once in a while across various system power cycles then the reading will need to be stored in nonvolatile memory such as Flash, FRAM or serial EEPROM. 

4) Whenever the sensor is placed on the sloped surface where a measurement is required then measure the angle reading from the sensor.

5) Go to storage and fetch the previous zero reading. Subtract the zero reading from the current sensor reading.

6) Present the difference reading to the user / system as the relative angle reading for the sloped surface.