Changing lsm303dlh calibration factors

I am using a lsm303dlh with an Arduino and a 5110 LCD. I would like to be able, thru a switch setting etc., to enter a calibration mode and when finished have the calibration factors updated. I’ve implemented a hold switch already so I can to the hardware part but I’m new to this type of programming and not sure how to change values of variables implemented in setup{} and that are being used w/ a library.

Thanks for your help,


Hello, Kevin.

The calibration values can be changed on-the-fly, and the updated values will be used in any calls to the heading() function after that point. The “Heading” example from our library assigns values to them in setup(), but you can change them at any time, including from within your loop() function.

- Kevin (me too)

Great! Thanks for your help.