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_Friday.cpp
- Revision:
- 11:44989c0bcea5
- Parent:
- 10:06cc2b1d2aaf
- Child:
- 12:c1a667ca6c53
--- a/AI_Friday.cpp Wed May 25 10:29:05 2016 +0000
+++ b/AI_Friday.cpp Wed May 25 10:36:45 2016 +0000
@@ -44,6 +44,17 @@
float v2 = 0.0, v2_ref = -60.0;
float v2_err = 0.0, v2_ierr = 0.0, PIout_2 = 0.0, PIout_2_old = 0.0;
+//**** receive and return by bluetooth ************** // bluetooth.getc()
+float xC, yC // car's position
+
+float angleC // car's angle
+
+float xP,yP //position that car need to reach
+
+float angleR // angleR = car-nextSpot direction ---> car direction
+
+int aI_State = 0;
+
int main() {
init_TIMER();
@@ -102,6 +113,43 @@
pwm2.write(PIout_2 + 0.5f);
TIM1->CCER |= 0x40;
+
+
+ //***** main AI **************************
+
+
+ //***** get position information from the bluetooth
+ xC = ;
+ yC = ; // car's position
+
+ angleC = ; // car's angle
+
+ xP = ;
+ yP = ;//position that car need to reach
+
+ angleR = ; // angleR = car-nextSpot direction ---> car direction
+
+ //**** AI_State ********************
+
+ switch(aI_State)
+ {
+ case 0:
+ break;
+ case 1:
+ break;
+ case 2:
+ break;
+ case 3:
+ break;
+ case 4:
+
+ }
+
+
+
+
+
+
switch(bluetooth.getc())
{
case '1':