ryosuke yumoto
/
ITG3200_I2C
test
Diff: main.cpp
- Revision:
- 0:d1f69bf9cfa4
diff -r 000000000000 -r d1f69bf9cfa4 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Jun 21 11:08:49 2013 +0000 @@ -0,0 +1,29 @@ +#include "ITG3200.h" +#include "mbed.h" + +Timer t; +Serial pc(USBTX, USBRX); +ITG3200 gyro(p9, p10); + + +int main() { + + + pc.printf("Now starting ITG-3200 test\n"); + //gyro1.setWhoAmI(0x6b); + wait(0.01); + pc.printf("ID is :0x%02x\n",gyro1.getWhoAmI()); + //Set highest bandwidth. + gyro1.setLpBandwidth(LPFBW_42HZ); + + //Arbitrary wait for printf clarity. + + wait(0.1); + t.start(); + while (1) { + + pc.printf("%i, %i, %i\n\r", gyro1.getGyroX(), gyro1.getGyroY(), gyro1.getGyroZ()); + + } + +}