The position data comes to the Teensy/Arduino from an amazing 9-axis Bosch BN055 chip / breakout board by Adafruit which has onboard fusing of 3-axis accelerometer, 3-axis gyroscope and 3-axis magnetometer.
It has a little LED on board which turns red when roll exceeds 30 degrees. Right now it takes power from a micro-usb port on the Teensy. Demo video below.