Sub Orient_AccelerometerChanged (X As Float, Y As Float, Z As Float)
If X < 5 AND Y > 5 Then ph.SetScreenOrientation(0) 'landscape
If X < -5 AND Y > -5 Then ph.SetScreenOrientation(1) 'portrait
If X > 5 AND Y < 5 Then ph.SetScreenOrientation(9) 'reverse portrait
If X > -5 AND Y < -5 Then ph.SetScreenOrientation(8)
End Sub