Final Version of food controller

Dependencies:   MMA8451Q TSI mbed

Fork of foodcontroller_NoWiFi by Serpentine

Revision:
4:1961b60aa8fb
Parent:
3:768cca7d53fe
Child:
5:c4bc5a92390a
--- a/main.cpp	Thu Jun 09 10:22:08 2016 +0000
+++ b/main.cpp	Thu Jun 09 10:31:59 2016 +0000
@@ -144,12 +144,30 @@
         
         wait(0.1);
         
-        /*if(abs(accY) > abs(accX))
+        if(abs(accY) > abs(accX))
         {
-            if(forward == e)
+            if(forward == true)
+            {
+                Direction = 0;
+            }//endif
+            else
             {
-                
-            }
-        }*/
+                Direction = 2;   
+            }//endelse
+        }//endif
+        else
+        {
+            if(right == true)
+            {
+                Direction = 1;   
+            }//endif
+            else
+            {
+                Direction = 3;    
+            }//endelse
+        }//endelse
+        
+        printf("Direction = %d \r\n", Direction);
+        
     }//endwhile
 }//endmain