saveMagnetometerCorrectionParameters vs setMagnetometerCorrectionParameters

Any hardware type questions or problems for all other Phidget devices.
Post Reply
mebrahimi
Fresh meat
Posts: 4
Joined: Thu Nov 09, 2017 8:51 am
Contact:

saveMagnetometerCorrectionParameters vs setMagnetometerCorrectionParameters

Post by mebrahimi »

What is the difference between these two methods: saveMagnetometerCorrectionParameters vs setMagnetometerCorrectionParameters?

also does resetMagnetometerCorrectionParameters restore original factory settings?
User avatar
mparadis
Site Admin
Posts: 959
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: saveMagnetometerCorrectionParameters vs setMagnetometerCorrectionParameters

Post by mparadis »

setMagnetometerCorrectionParameters allows you to set the parameters for as long as the object remains open. If the object disconnects, the parameters will reset.

saveMagnetometerCorrectionParameters saves the currently set parameters to flash memory on the device, so that these parameters are automatically used when the device is connected. (This is not supported on the older 1056 PhidgetSpatial).

resetMagnetometerCorrectionParameters resets the current and saved parameters to zero (which is the factory setting for the parameters).
mebrahimi
Fresh meat
Posts: 4
Joined: Thu Nov 09, 2017 8:51 am
Contact:

Re: saveMagnetometerCorrectionParameters vs setMagnetometerCorrectionParameters

Post by mebrahimi »

Thank you. I've been struggling with getting compass to work. Will keep playing with it.
User avatar
Patrick
Lead Developer
Posts: 3403
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: saveMagnetometerCorrectionParameters vs setMagnetometerCorrectionParameters

Post by Patrick »

Unless you are using the 1056, you should not have to call these functions yourself - you should use the provided compass calibration software which will set and save the parameters to flash.

-Patrick
mebrahimi
Fresh meat
Posts: 4
Joined: Thu Nov 09, 2017 8:51 am
Contact:

Re: saveMagnetometerCorrectionParameters vs setMagnetometerCorrectionParameters

Post by mebrahimi »

I'm using a 1044 and did use the calibration software. Did not get consistent results - it seemed like it could accurately detect one direction, and 180 degree opposite, but in between, it was not linear (i.e. at 90 degrees, I would see 120). I will play with it some more tonight.
User avatar
Patrick
Lead Developer
Posts: 3403
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: saveMagnetometerCorrectionParameters vs setMagnetometerCorrectionParameters

Post by Patrick »

It takes a surprisingly small amount of metal to interfere with the compass. It's best to run the calibration with the spatial already bolted into it's final place in your application. Sources of metal in the environment will need to be avoided, especially during calibration.

-Patrick
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 27 guests