BlazeX / Gyro_ITG3200

Files at this revision

API Documentation at this revision

Comitter:
user BlazeX
Date:
Mon May 28 09:48:43 2012 +0000
Child:
1:e3982fc0385d
Commit message:

Changed in this revision

ITG3200.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ITG3200.lib	Mon May 28 09:48:43 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/BlazeX/code/ITG3200/#14ba7ccda52b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon May 28 09:48:43 2012 +0000
@@ -0,0 +1,36 @@
+#include "mbed.h"
+#include "ITG3200.h"
+
+Serial PC(USBTX, USBRX);
+Serial XBee(p28, p27);
+I2C I2CBus(p9, p10);
+Timer GlobalTime;
+
+ITG3200 Gyro(I2CBus, GlobalTime);
+
+int main() 
+{
+    PC.baud(115200);
+    XBee.baud(115200);
+    I2CBus.frequency(400000);
+    GlobalTime.start();
+    
+    //Starten
+    Gyro.Init();
+    wait_ms(500);
+    
+    //0.5 Sekunden kalibrieren
+    Gyro.Calibrate(500);
+    
+    while(1)
+    {
+        Gyro.Update();
+        
+        XBee.printf("%i %i %i\r\n",
+            (int)(Gyro.RawRate[0]),
+            (int)(Gyro.RawRate[1]),
+            (int)(Gyro.RawRate[2]);
+        
+        wait_ms(10);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon May 28 09:48:43 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/63bcd7ba4912