The Microsoft Surface Pro has a gyroscope and accelerometer, Windows 8, and the full .NET framework.
Most articles I find that talk about the motion API point to the Windows Phone 8 API.
What .NET Framework namespaces and classes should I be using to get gyroscope and accelerometer data from?
I just worked based off the documentation - http://msdn.microsoft.com/en-us/library/ie/windows.devices.sensors
using Windows.Devices.Sensors;
private Accelerometer _accelerometer;
private void DoStuffWithAccel()
{
_accelerometer = Accelerometer.GetDefault();
if (_accelerometer != null)
{
AccelerometerReading reading = _accelerometer.GetCurrentReading();
if (reading != null)
double xreading = reading.AccelerationX;
... etc.
}
}
Haven't tested it, but it should work for any Windows Store App - If you're trying to make it run as a console/windows forms app, you need to change the targetplatform by: