use this

Dependencies:   mbed

Fork of greenimugetithothot by SGMP Coperations

Revision:
0:92bbf3093a25
Child:
1:44b26709b117
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Dec 07 14:20:22 2017 +0000
@@ -0,0 +1,29 @@
+#include "mbed.h"
+#include "zmu9250.h"
+#include "math.h"
+
+ZMU9250 axis_Gen;
+
+Serial pc(D1, D0);
+
+float axis_gz, axis_gy, axis_gx;
+float axis_az, axis_ay, axis_ax;
+
+int main(){
+
+    while(1){
+        wait(0.1);
+        axis_Gen.Update();
+        axis_ax = axis_Gen.g_ax()*180;
+        axis_ay = axis_Gen.g_ay()*180;
+        axis_az = axis_Gen.g_az()*180;
+        axis_gx = axis_Gen.g_gx()*180;
+        axis_gy = axis_Gen.g_gy()*180;
+        axis_gz = axis_Gen.g_gz()*180; 
+        //pc.printf(" axis_x %f\t axis_y %f\t axis_z %f\n\n\n\r", axis_gx, axis_gy, axis_gz);     
+        pc.printf(" axis_x %f\t axis_y %f\t axis_z %f\n\n\n\r", axis_ax, axis_ay, axis_az);
+        wait(0.2);     
+     }
+}
+
+    
\ No newline at end of file