test program

Dependencies:   mbed-rtos mbed

Files at this revision

API Documentation at this revision

Comitter:
lokitsyu
Date:
Sat Jul 13 05:52:47 2013 +0000
Parent:
1:5c6888eb051a
Commit message:
not good yet

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Sat Jul 13 05:17:34 2013 +0000
+++ b/main.cpp	Sat Jul 13 05:52:47 2013 +0000
@@ -32,11 +32,12 @@
             ay_1, ay_2, ay_3, 
             az_1, az_2, az_3;
         float ax, ay, az;        //angr value
+        double sum;
     public:
         void get();
         void set();
         void calc();
-        void simpson();
+        double simpson(double,double,double);
 };
 //get gyro value
 void Gyro::get()
@@ -60,7 +61,8 @@
         i2c.start();
         ax_1 = ax_1 + i2c.read();
         i2c.stop();
-    }else{}
+    }else{
+    }
 }
 
 //setting gyro sencer
@@ -72,8 +74,10 @@
 {
 }
 
-void Gyro::simpson()
+double Gyro::simpson(double f_0,double f_1,double f_2)
 {
+    sum += (f_0 + 4 * f_1 + f_2)/6000;
+    return sum;
 }