http://mbed.org/users/Digixx/code/ITG3200/#8967cbe04d96