calculate

Dependencies:   mbed X_NUCLEO_IKS01A3 Mahony_Algorithm

Revision:
3:795998b31c32
Parent:
2:4cccdc792719
Child:
4:7d13076ecece
diff -r 4cccdc792719 -r 795998b31c32 main.cpp
--- a/main.cpp	Wed Apr 15 12:13:15 2020 +0000
+++ b/main.cpp	Thu Apr 16 19:34:49 2020 +0000
@@ -24,6 +24,7 @@
 
 #include "mbed.h"
 #include "CalculateData.h"
+#include "Liste.h"
 
 
 //initialise DigitalIO
@@ -34,24 +35,23 @@
 //Generate object
 CalculateData calculate(D14, D15, D4, D5, A3, D6, A4);
 
-int pos[3];
-int speed[3];
-int acc[3];
+
+
+
 
 int main(){
+    Liste myList;
     calculate.enable();
     while(1){    
-        calculate.run();
-        calculate.getAccelerometer(acc);
-        calculate.getSpeed(speed);
-        calculate.getPosition(pos);
         
-        printf("\r\n----------\r\n\n");
-        printf("Accelerometer: \t%5.2f\t%5.2f\t%5.2f\r\n",(double)acc[0], (double)acc[1], (double)acc[2]);
-        printf("Speed: \t\t%5.2f\t%5.2f\t%5.2f\r\n",(double)speed[0], (double)speed[1], (double)speed[2]);
-        printf("pos: \t\t%5.2f\t%5.2f\t%5.2f\r\n%i",(double)pos[0], (double)pos[1], (double)pos[2], calculate.t);
-        printf("\r\n----------\r\n\n");
-        wait_ms(1000);
+        calculate.getValue(&myList);
+        printf("\t\tX\t\tY\t\tZ\r\n");
+        printf("ACC:\t\t%f\t%f\t%f\r\n", myList.accX, myList.accY, myList.accZ);
+        printf("SPEED:\t\t%f\t%f\t%f\r\n", myList.speedX, myList.speedY, myList.speedZ);
+        printf("POS:\t\t%f\t%f\t%f\r\n", myList.posX, myList.posY, myList.posZ);
+        printf("\r\n\r\n-------------------------\r\n\r\n\r\n");
+        
+        Thread::wait(100);
     }
 }