Example for ITG3200 gyro

Dependencies:   ITG3200 mbed

Fork of ITG3200_HelloWorld by Aaron Berk

Revision:
2:e2676f02a6b1
Parent:
1:6a040ee9e40b
--- 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);
     }
 
 }