Sub Process_Globals
Dim Accelerometer As PhoneAccelerometer
End Sub
Sub Globals
Dim lblAngle As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
lblAngle.Initialize("")
lblAngle.TextSize = 20
Activity.AddView(lblAngle, 40%x, 45%y, 20%x, 30dip)
End If
End Sub
Sub Activity_Resume
Accelerometer.StartListening("Accelerometer")
End Sub
Sub Activity_Pause (UserClosed As Boolean)
Accelerometer.StopListening
End Sub
Sub Accelerometer_AccelerometerChanged (X As Float, Y As Float, Z As Float)
lblAngle.Text = "Angle = " & Round(ATan2D(Y, X))
End Sub