Reputation: 39820
I've been following this tutorial, but I'm getting this exception and it's very confusing. I enabled ID_CAP_SENSORS in the manifest, so that's not the problem.
The error happens when I try to initialise accelerometer or gyroscope in my constructor:
m_accelerometer = Windows::Devices::Sensors::Accelerometer::GetDefault();
m_gyrometer = Windows::Devices::Sensors::Gyrometer::GetDefault();
Upvotes: 1
Views: 578
Reputation: 9604
You can't test gyroscope code on the Windows Phone emulator at this time.
See http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202943(v=vs.105).aspx.
Important Note:
You cannot test this app on the emulator. The emulator doesn’t support the gyroscope. You can only test this app on a registered phone.
Also beware that not all Windows Phones have gyroscope hardware.
Upvotes: 2