Robotics Term Project / Mbed 2 deprecated Robottics_Motion

Dependencies:   mbed

Revision:
6:f4250d71f974
Parent:
5:794d7d690dc9
Child:
7:1232c7939984
--- a/ai.cpp	Tue May 24 07:58:29 2016 +0000
+++ b/ai.cpp	Tue May 24 08:10:47 2016 +0000
@@ -52,22 +52,23 @@
 
 switch(mobile_state)
 {
-    case 0: 
+    case 0:   // IDLE
             // IDLE check if stop color appear 
             //check purple color appear or not 
            
         setSpecs();
         break;
-    case 1: 
+    case 1:   // get first information 
             //  set everything icludes the car's and ball's position
             //  go to case 2 after get all the information
         break;
-    case 2: 
+    case 2:   ///   border condition
         // check if car fit border conditions
         funcBorder();
         to case3
         break;
     case 3://move to get ball
+          
         getBall();
         break;
     case 4: /// move to the gate and release ball
@@ -235,7 +236,26 @@
 }
 
 
-**********  
+**********   getBall()  ********************88
+
+getBall()
+{
+    // keep update car's and ball's position date from bluetooth
+    
+    // if angleR is too much, stop , aim the direction, then move again  
+    
+    // when ball in the hunt region, activate the claw to get the ball
+    
+    // check if ball is inside the region , 
+    
+    // Yes -->  next state case
+    
+    // No -->   take back the claw
+    
+    // back to case 1
+    
+        
+}