Magnetometer constant zero
Answer
4/27/15 9:25 AM
Hi Community,

I have connected the XDK to my Laptop using USB and started the Windows Java Application. Unfortunately the graph of the magnetometer stays constantly at 0.
Do I have to calibrate the magnetometer somehow or does that mean, that the magnetometer of my XDK might be disabled/broken?

Thanks for your help.

BR,
Florian
0 (0 Votes)
Magnetometer constant zero
Answer
4/27/15 3:08 PM as a reply to Florian Dittrich.
Do you have done the initialisation. I use this Sensor too and have to do the initialisation two times because the First try throws everytime a error
0 (0 Votes)
Magnetometer constant zero
Answer
4/28/15 6:20 AM as a reply to Mario Schillmüller.
What do you mean by initialisation?
What I did is, I flashed the XDK with the DSM_demoSensorMonitor Project. Then I started the Windows Application via Eclipse, clicked on the settings icon and selected COM6. After connecting the Magnetometer sensor shows 0 all the time even though I moved it around quite allot.
See the attached screenshots.
0 (0 Votes)
Magnetometer constant zero
Answer
4/28/15 7:05 AM as a reply to Florian Dittrich.
I dont work with the Demo Applikation... To use the Sensor you just have to include "magnetometer.h" and "xdk_sensors.h".Nowyou must do the initialisation with "magnetometerInit(xdkMagnetometer_BMM150_Handle)". I have to call the Function two Times because the first try return a Sensor error. After that you have to create a struct "magnetometer_xyzData_t Data" and now you can read the Data with "magnetometerReadXyzLsbData(xdkMagnetometer_BMM150_Handle, &Data)". If you want to know the Values you can print it on console with printf("X: %ld",Data.xAxisData)"for example.
0 (0 Votes)