I'm creating a sensor object to create a compass app. However, the direction in degrees isn't working. Azimuth 0 value
Android 12
function OnStart()
{
lay = app.CreateLayout( "Linear", "VCenter,FillXY" );
txt = app.CreateText( "", 0.8, 0.3, "Multiline" );
lay.AddChild( txt );
app.AddLayout( lay );
sns = app.CreateSensor( "Orientation" );
sns.SetOnChange( sns_OnChange );
sns.Start();
}
function sns_OnChange( azimuth, pitch, roll, time )
{
var msg = " azimuth = " + azimuth.toFixed(1);
msg += "\n pitch = " + pitch.toFixed(1);
msg += "\n roll = " + roll.toFixed(1);
txt.SetText( msg );
}