The latest gizmo that you can make using the cheap and easy Raspberry Pi is here courtesy of [Mark Williams]. He has hooked up an inertial measurement unit (IMU) to the Pi and built an inclinometer to use to measure the various angles of an off-road vehicle.
This particular guide goes through the setup of SDL to control the video output to a small screen. Then, a function is created to rotate the images based on input from the IMU so that the vehicle position can be shown graphically on the screen. Now, when your truck is about to roll over on a hill, you’ll get advance warning!
Of course, this whole project is predicated on installing the IMU and getting it up and running on the Raspberry Pi in the first place. [Mark] has you covered on a guide for setting that up as well. This delves into setting up the IMU over I2C to get it talking to the Raspberry Pi, and then converting the raw data from the IMU into data that is more usable. Be sure to check out [Mark]’s page for all of the code and details!

http://hackaday.com/2014/12/16/creat...-raspberry-pi/