Dude, where’s my accelerometer? And can I get a gyro with that?

Oh crude, what is that headline, what has happened to my titles?  Have I gone crazy?  No, no more than normal.  Ok, maybe.

The accelerometer is turned on in the phone by using the the following reference and using statement in your code.  Gyros may be available in the future,

Set a reference to:

Microsoft.Devices.Sensors

Step 1, the Microsoft.Devices.Sensors is not referenced by default (why not?  I don’t know):

image

 

Step 2 select the Microsoft.Devices.Sensors namespace:

image

image

Step 3 add the using statement, note the added using Microsoft.Devices.Sensors and the sensor isn’t in the Microsoft.Phone related namespaces (I just thought to say that because I always try Microsoft.Phone and then wonder why sensors up in the intellisense list.

 

image

 

Now you get to work with the accelerometer.

Not going to write anymore about the accelerometer today.  Hope this helps you out.