How can i get the direction and the angle of my phone using the accelerometer and the magnetic sensor..
I want the horizontal direction and the angle between the floor and the mobile phone like -> _| = 90º
thank you in advance
Cumps
Artur Ataíde
'Sub Process_Globals:
Dim OrientationSensor As PhoneSensors
'Sub Activity_Create:
If FirstTime Then _
OrientationSensor.Initialize2(OrientationSensor.TYPE_ORIENTATION, 2)
'Sub Activity_Resume:
OrientationSensor.StartListening("OrientationSensor")
'Sub Activity_Pause:
OrientationSensor.StopListening
'Sub OrientationSensor_SensorChanged(Values() As Float):
Dim NewOrientation As Int
NewOrientation = Round(Values(0))
'...
'Sub Process_Globals:
Dim OrientationSensor As PhoneSensors
'Sub Activity_Create:
If FirstTime Then _
OrientationSensor.Initialize2(OrientationSensor.TYPE_ORIENTATION, 2)
'Sub Activity_Resume:
OrientationSensor.StartListening("OrientationSensor")
'Sub Activity_Pause:
OrientationSensor.StopListening
'Sub OrientationSensor_SensorChanged(Values() As Float):
Dim NewOrientation As Int
NewOrientation = Round(Values(0))
'...