Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: ai.cpp
- 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
+
+
+}