title: why use accelerometer and magnetometer to get compass values
body: <p>I found several examples and I know HOW to get the compass bearing using accelerometer and magnetometer. The problem is that i don't know WHY these two sensors should be used.
  can someone explain it to me? thanks</p>