Mark Horn
/
WITGyro
WITGyro
Diff: main.cpp
- Revision:
- 0:0d844f8ecb72
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Nov 11 21:00:18 2013 +0000 @@ -0,0 +1,24 @@ +#include "mbed.h" +#include "ITG3200.h" +#include "Terminal.h" + +Terminal term(USBTX, USBRX); +ITG3200 gyro(p9, p10); + +int main() + { + wait(1); + term.printf("Starting Gyro test... \n \r"); + gyro.setLpBandwidth(LPFBW_42HZ); + int x = 0; + int y = 0; + int z = 0; + while (1) + { + wait(0.2); + x = gyro.getGyroX(); + y = gyro.getGyroY(); + z = gyro.getGyroZ(); + term.printf("X-%i Y-%i Z-%i \n \r", x,y,z); + } + } \ No newline at end of file