Create Sensor - Orientation - Azimuth 0.0

150 views
Skip to first unread message

Alan Hendry

unread,
Apr 12, 2021, 6:53:17 AM4/12/21
to DroidScript
Hi,
DS 2.06 Android 10 Go
When I run the Create Sensor Orientation Example the Azimuth is always 0.0
Pitch and Roll change, I presume the units are degrees.
Regards, ah

Steve Garman

unread,
Apr 12, 2021, 7:15:55 AM4/12/21
to DroidScript
Perhaps you have a limited sensor on your device

I get all 3 values constantly changing when I run the Orientation examplr from the Docs
Screenshot_20210412-120014.jpg

Alan Hendry

unread,
Apr 12, 2021, 8:51:35 AM4/12/21
to DroidScript
Hi,
On another device (Nougat) it works.
Could be a defect on the failing phone (not sure it makes sense to have a sensor for 2 axes only).
Thanks, ah

Steve Garman

unread,
Apr 12, 2021, 9:33:38 AM4/12/21
to DroidScript
Sensors are more complicated than we assume at first sight

Historically (perhaps now too) if a device did not have one of the common sensors Android would attempt to emulate it using more than one other sensor
I wouldn't be surprised if that's more necessary on Android Go

One of the few things sns.GetNames is useful for is to let us guess what sensors are available on a device

Try using the GetNames example on both devices and see if it gives you any clues

function OnStart()
{
    sns = app.CreateSensor();
    var names = sns.GetNames();
    app.Alert(names.replace(/,/g, ",\n"), "Sensor Names");
}

Alan Hendry

unread,
Apr 14, 2021, 6:18:54 AM4/14/21
to DroidScript
Hi,
On the Android 10 Nokia 1.3 the Example seems to show a list of hardware including
Two for BMA25X Accel, three for MN59XXX ALS/PS (ambient light/proximity), four for Steps, Significant Motion, Tilt,
AMD (temperature), RMD (radiation?), Gestures, Facing, Pedometer, Motion Accel, Coarse Motion, SX9310 SAR (radar?).
On Oreo Alcatel 3 (where azimuth is shown)
Accelerometer, Magnetometer, Orientation, Light, Proximity, Significant_Motion, GeoMag Rotation Vector Sensor 
Regards, ah

Steve Garman

unread,
Apr 14, 2021, 6:33:47 AM4/14/21
to DroidScript
BMA25X Accel is a perfectly good 3-axis accelerometer so your original guess about the failing phone is probably as good as any
Reply all
Reply to author
Forward
0 new messages