Phidget Spatial Basic 3/3/3 - Compass bearing

Supporting Browser-based Javascript and Node.js
Stella.bilodeau
Fresh meat
Posts: 2
Joined: Thu Oct 25, 2018 9:10 am
Contact:

Phidget Spatial Basic 3/3/3 - Compass bearing

Postby Stella.bilodeau » Thu Oct 25, 2018 9:13 am

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 :? .

User avatar
mparadis
Site Admin
Posts: 626
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

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

Postby mparadis » Thu Oct 25, 2018 9:18 am

You'll have to calculate bearing manually. See this page in our documentation for more information.

Stella.bilodeau
Fresh meat
Posts: 2
Joined: Thu Oct 25, 2018 9:10 am
Contact:

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

Postby Stella.bilodeau » Thu Oct 25, 2018 9:23 am

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?

User avatar
mparadis
Site Admin
Posts: 626
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

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

Postby mparadis » Thu Oct 25, 2018 9:31 am

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.


Return to “Javascript”

Who is online

Users browsing this forum: No registered users and 1 guest