Seeed
/
Seeed_Grove_Digital_Gyro
Example for ITG3200 gyro
Fork of ITG3200_HelloWorld by
Revision 2:e2676f02a6b1, committed 2014-08-15
- Comitter:
- sam_grove
- Date:
- Fri Aug 15 23:48:46 2014 +0000
- Parent:
- 1:6a040ee9e40b
- Commit message:
- Initial commit
Changed in this revision
diff -r 6a040ee9e40b -r e2676f02a6b1 ITG3200.lib --- a/ITG3200.lib Sat Nov 27 11:44:44 2010 +0000 +++ b/ITG3200.lib Fri Aug 15 23:48:46 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/aberk/code/ITG3200/#b098d99dd81e +http://mbed.org/teams/components/code/ITG3200/#ff0a59c5c2f7
diff -r 6a040ee9e40b -r e2676f02a6b1 main.cpp --- a/main.cpp Sat Nov 27 11:44:44 2010 +0000 +++ b/main.cpp Fri Aug 15 23:48:46 2014 +0000 @@ -1,22 +1,22 @@ + +#include "mbed.h" #include "ITG3200.h" -Serial pc(USBTX, USBRX); -ITG3200 gyro(p9, p10); +ITG3200 gyro(D14, D15, 0x68); -int main() { - - pc.printf("Now starting ITG-3200 test...\n"); - +int main(void) +{ + int x = 0, y = 0, z = 0, temp = 0; //Set highest bandwidth. gyro.setLpBandwidth(LPFBW_42HZ); while (1) { - - //Arbitrary wait for printf clarity. - wait(0.1); - pc.printf("%i, %i, %i\n", gyro.getGyroX(), - gyro.getGyroY(), gyro.getGyroZ()); - + wait(0.1f); + x = gyro.getGyroX(); + y = gyro.getGyroY(); + z = gyro.getGyroZ(); + temp = gyro.getTemperature(); + printf("Temp: %d, X: %d, Y: %d, Z: %d\n", temp, x, y, z); } }
diff -r 6a040ee9e40b -r e2676f02a6b1 mbed.bld --- a/mbed.bld Sat Nov 27 11:44:44 2010 +0000 +++ b/mbed.bld Fri Aug 15 23:48:46 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/9114680c05da +http://mbed.org/users/mbed_official/code/mbed/builds/9327015d4013 \ No newline at end of file