How to get accelerometer data @100Hz on Windows8 Slate PC RRS feed

  • Question

  • Hi all,

    I am a newbye in Windows8+Sensors development so forgive me if i ask the wrong questions.


    I need to collect accelerometer data (and gyro later) at 100Hz (more or less) in "desktop" mode (NOT Metro) in a C# app

    I am using a Samsung SlatePC XE700 where i installed windows8 

    I am trying to use the sample code included in the Windows API Code Pack 1.1.

    Problem getting data at 100hz

    i am setting the accelerometer ReportInterval at 10ms (accel.ReportInterval = 10;) but the property return always "16"

    also, i am noticing that the callback DataReport_Changed is called only when the data changes, at the maximum (when i move the device) seems like 5 times/sec( 5Hz). 

    i tried to poll the sensor using a timer and accel.UpdateData and i do get 100 reading (obviously since i am using a timer and synchronous call) but it seems the values are not updated every time even though i call UpdateData .


    - is what i am doing correct?

    - what is the best way to get 100Hz out of an accelerometer, if possible. or any workaround? 5Hz is not really usable for almost anything serious....

    ****Bug report****

    I am using the sample code "AccelerationMeasurement" in the code pack, and it fails for a casting problem.

    It seems the low level COM component is returning double values as accelerations, whereas the class Acceleration3D is trying to cast the values to float, hence the crash. i had to change the ctor public Acceleration3D(SensorReport report) to correctly use double instead of float.

    Thank you so much for your attention,


    Saturday, April 7, 2012 2:17 AM