Page 1 of 1

Phidget Spatial Basic 3/3/3 - Compass bearing

Posted: Thu Oct 25, 2018 9:13 am
by Stella.bilodeau
Hi :D ,

I would like to know how to access the bearing data of the compass in javascript.

I found the acceleration, the three axis of the compass and the magnetic field, but not the bearing of the compass :? .

Re: Phidget Spatial Basic 3/3/3 - Compass bearing

Posted: Thu Oct 25, 2018 9:18 am
by mparadis
You'll have to calculate bearing manually. See this page in our documentation for more information.

Re: Phidget Spatial Basic 3/3/3 - Compass bearing

Posted: Thu Oct 25, 2018 9:23 am
by Stella.bilodeau
mparadis wrote:You'll have to calculate bearing manually. See this page in our documentation for more information.

Would you have an example in javascript?

Re: Phidget Spatial Basic 3/3/3 - Compass bearing

Posted: Thu Oct 25, 2018 9:31 am
by mparadis
This is the only example we have, but it's mostly math so if you understand what's being calculated it should be easy to convert to JavaScript.