Project Description
Includes a white paper as well as sample: firmware, driver, and application.
The white paper describes how you can: build a simple game controller, create a Sensor device driver, and modify the XNA Racing Game Starter Kit sample so that your controller works with the game.
The sample firmware can be used to program a Parallax BS2 microcontroller.
The sample driver supports communication between a Windows 7 application and the sensor. (Note that in addition to a dual axis accelerometer, the driver also supports a compass, a passive-infrared sensor, and an ultra-sonic distance sensor.)
The XNA Racing Game Starter Kit sample demonstrates how you can write a complete auto-racing game in C# with .Net.
Included with this project are three updated source files and a COM Interop which let the game receive input from your game controller. You will copy these updated source files over the files of the same name in the XNA Racing Game Starter Kit.
The following image shows a user controlling the Racing Game with the game controller.
As the user tilts the controller board along the positive y-axis, the car accelerates; as they tilt the board along the negative y-axis, the car slows down. As they tilt the board along the positlve x-axis, the car turns to the right; as they tilt the board along the negative x-axis, the car turns to the left.
The Sample Circuit
The sample circuit is based on the Parallax BASIC Stamp 2 microcontroller and the Memsic 2-axis accelerometer. For more information about both, refer to the Parallax website at
http://www.parallax.com.
The following image shows the circuit as it was constructed on the Parallax BASIC Stamp Homework Board:
Project Resources
You can download the updated application source files, the COM Interop, and an accompanying white paper from this project's Downloads tab.
This sample uses firmware and a sample driver provided by Microsoft. To download both the firmware and sample driver sources, see "Using Windows 7 to Monitor a Motion Sensor" on MSDN Code Gallery
http://archive.msdn.microsoft.com/motionsensor.