Answered by:
Getting raw readings from Compass

Question
-
Hi all,
I am writing an app that needs raw readings from the magnetometer (x, y and z, in nano or microteslas). I looked at the compass API (http://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.sensors.compassreading) and it doesn't seem to give me those values, is there other API to get that?
thanks!
Anthony
Wednesday, August 8, 2012 6:59 PM
Answers
-
That is correct, you cannot get the raw readings from the magnetometer from a metro application. We did not have a scenario where the raw magnetometer data would be necessary.
This posting is provided "AS IS" with no warranties, and confers no rights.
- Marked as answer by Min ZhuMember Thursday, August 23, 2012 6:21 AM
Tuesday, August 14, 2012 8:05 PM
All replies
-
The magnetometer is not exposed through the WinRT interface. You can access it through the Sensor API: http://msdn.microsoft.com/en-us/library/windows/desktop/dd318953(v=vs.85).aspx
Why do you need to access the magnetometer?
This posting is provided "AS IS" with no warranties, and confers no rights.
Wednesday, August 8, 2012 7:43 PM -
It looks like sensor manager (CLSID_SensorManager) is if-def out with WINAPI_PARTITION_DESKTOP on metro apps, is there any other way to interact with the sensors without using sensor manager?
thanks!
Tuesday, August 14, 2012 5:16 PM -
You cannot use the Win32 Sensor API from a metro application. You can only access it from a desktop application.
This posting is provided "AS IS" with no warranties, and confers no rights.
Tuesday, August 14, 2012 5:43 PM -
Does that mean there's no way for me to get raw readings from the magnetometer? if so, is there a reason why the raw reading isn't part of the WinRT compass API?Tuesday, August 14, 2012 6:46 PM
-
That is correct, you cannot get the raw readings from the magnetometer from a metro application. We did not have a scenario where the raw magnetometer data would be necessary.
This posting is provided "AS IS" with no warranties, and confers no rights.
- Marked as answer by Min ZhuMember Thursday, August 23, 2012 6:21 AM
Tuesday, August 14, 2012 8:05 PM