How to use gyroscope in wp8 project?

My problem is that visual studio 2012 gives the following error when using gyroscope in monogame 3.2 project:

Error	1	The type 'Microsoft.Xna.Framework.Vector3' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Xna.Framework, Version=, Culture=neutral, PublicKeyToken=842cf8be1de50553'.	C:\Users\xyz\Projects\xyz\GamePage.xaml.cs	
Error	2	Cannot implicitly convert type 'Microsoft.Xna.Framework.Vector3' to 'Microsoft.Xna.Framework.Vector3 [c:\Program Files (x86)\MonoGame\v3.0\Assemblies\WindowsPhone\ARM\MonoGame.Framework.dll]'	C:\Users\xyz\Projects\xyz\GamePage.xaml.cs

Here’s the code I’m trying to use to read sensor data:

Vector3 currentRotationRate = Vector3.Zero;
gyroscope = new Gyroscope();
gyroscope.CurrentValueChanged += new EventHandler<SensorReadingEventArgs<GyroscopeReading>>(gyroscope_CurrentValueChanged);
void gyroscope_CurrentValueChanged(object sender, SensorReadingEventArgs<GyroscopeReading> e)
     currentRotationRate = e.SensorReading.RotationRate;

Any ideas on how to resolve this issue? Btw. this error comes from otherwise blank new monogame project.


this worked for me, some time ago.


thank you for the link. I actually found it before posting my question, but I thought that this problem had been solved some other way by now. Well, I guess I’ll have to follow your example :smile: