I managed to get tilt working properly (sort of) with portrait orientation. But when it comes to landscape the angles are constantly switching. Is there a formula that can be used to normalize the angles to simply read the the left to right tilt holding the phone as a landscape view? I know it's to do with the orientation limits (-90 to 90, 0 - 180, 0 - 360). The relationship between each of the angles is beyond me.
Here are the events i'm using for portrait tilt.