with i2c

Dependencies:   mbed-rtos mbed

Fork of BAE_b4hw_test by sakthi priya amirtharaj

Revision:
8:6d856d863537
Parent:
7:603c2a89effc
diff -r 603c2a89effc -r 6d856d863537 main.cpp
--- a/main.cpp	Fri Feb 27 19:06:04 2015 +0000
+++ b/main.cpp	Wed Mar 04 18:14:01 2015 +0000
@@ -96,7 +96,10 @@
 {
     float *mag_field;
     float *omega;
-    float *moment;
+    float mag_field1[3];
+    float omega1[1];
+    float tauc1[3];
+    float moment[3];
     float *mnm_data;
     while(1)
     {
@@ -118,22 +121,33 @@
         }
         for(int i = 0 ; i<3;i++)
         {
-            omega[i] = mnm_data[i];
+            omega1[i] = mnm_data[i];
         }
         for( int i = 3;i<6;i++)
         {
-            mag_field[i-3] = mnm_data[i];
+            mag_field1[i-3] = mnm_data[i];
         }
         if(acs_pflag == 1)
         {
-        moment = FUNC_ACS_CNTRLALGO(mag_field,omega);
+        FUNC_ACS_CNTRLALGO(mag_field1,omega1,tauc1);
+        printf("\n\r control algo values ");
+        for(int i=0; i<3; i++) 
+        {
+        printf("%f\t",tauc1[i]);
+        }
+        moment_calc (tauc1, mag_field1,moment);
+        printf("\n\r moment values ");
+        for(int i=0; i<3; i++) 
+        {
+        printf("%f\t",moment[i]);
+        }
+        
         FUNC_ACS_GENPWM(moment);                     
         }
        
         t.reset();
     }
-}
-/*
+}/*
 void T_ACS_WRITE2FLASH(void const *args)
 {
     while(1)