Dear everyone,
I am using the orientation sensor as my compass and my device is at #SupportedOrientations: landscape
PCMain.Initialize2(PCMain.TYPE_ORIENTATION, 0)
PCMain.StartListening("SensorCMain")
Sub SensorCMain_SensorChanged (Values() As Float)
Racc1 = Values(0)
End Sub
The code above works fine if the device is lying flat. If I were to tilt the device 90 degrees or more, the compass gets reversed. I know that I can use Javaobject remapCoordianteSystem to overcome this but I have no idea on how to get about doing this. I have been reading through the forums but I have no idea how to start.
Dim jo As JavaObject
jo.InitializeStatic("android.hardware.SensorManager")
jo.RunMethod("remapCoordianteSystem", Array(inR, X, Y, outR))
Thanks.
I am using the orientation sensor as my compass and my device is at #SupportedOrientations: landscape
PCMain.Initialize2(PCMain.TYPE_ORIENTATION, 0)
PCMain.StartListening("SensorCMain")
Sub SensorCMain_SensorChanged (Values() As Float)
Racc1 = Values(0)
End Sub
The code above works fine if the device is lying flat. If I were to tilt the device 90 degrees or more, the compass gets reversed. I know that I can use Javaobject remapCoordianteSystem to overcome this but I have no idea on how to get about doing this. I have been reading through the forums but I have no idea how to start.
Dim jo As JavaObject
jo.InitializeStatic("android.hardware.SensorManager")
jo.RunMethod("remapCoordianteSystem", Array(inR, X, Y, outR))
Thanks.