Android Question Phone Sensor Orientation x starting point

Scantech

Well-Known Member
Licensed User
Longtime User
Is Phone Sensor Orientation Type X value ranges from 0 to 360? x seems a bit off. Do we have to calibrate it to have it set at x = 0 when phone is portrait mode?
 

emexes

Expert
Licensed User
Are Tablets Accelerometer different then Phone?
I don't know, but it would not surprise me if (some) tablets regarded landscape orientation as normal, and the accelerometer axes were oriented accordingly.

And if you're running an emulator, all bets are off ;-)

On a related note: in my bang-it-up-fast code, I used orientation values 8,9,6,3,2,1,4,7 arranged as per numeric keypad, but in retrospect, would be better just using degrees (or multiples of 45 or 90 degrees).
 
Upvote 0

emexes

Expert
Licensed User
Righto, step one is these measurements, where the angle is clockwise (like a compass) ie negative = tilted left, positive = tilted right, with 0 degrees being phone upright aka portrait:

Updated to include Onix AT9-014 tablet running Android 4.4.2 (locked to portrait mode, ironically).

B4X:
device   phone      tablet
angle   x    y      x    y

-135    7   -7      7    7
 -90   10    0      0   10     landscape, tilted to left (anticlockwise)
 -45    7    7     -7    7
   0    0   10    -10    0     portrait
  45   -7    7     -7   -7
  90  -10    0      0  -10     landscape, tilted to right (clockwise)
 135   -7   -7      7   -7

Accelerations in metres-per-second-per-second, where earth's gravity is (close enough to) 10. Hallelujah! One small step in the long journey of dragging youse Yanks towards the glorious coherence of SI ;-)[/QUOTE]
 
Last edited:
Upvote 0

emexes

Expert
Licensed User
Speaking of ironic, yesterday happened upon this map.

"At this time, only three countries—Burma, Liberia, and the US—have not adopted the International System of Units (SI, or metric system) as their official system of weights and measures."

The "Axis of Medieval" reference was kinda funny (although that might just be my weird humour, juxtaposing it with George W Bush and his Axis of Evil).

metric-system-map_0.png
 
Upvote 0
Top