Dr. Davis and Dr. Dyer special studies robotics project

Dependencies:   BSP_DISCO_F469NI LCD_DISCO_F469NI TS_DISCO_F469NI mbed Motordriver

Fork of Configurable_Robots by Christopher Eubanks

Files at this revision

API Documentation at this revision

Comitter:
blu12758
Date:
Thu May 11 16:20:54 2017 +0000
Parent:
20:4173e6b7adde
Commit message:
OA changed to OF

Changed in this revision

Classes/RobotMVC/RobotController.cpp Show annotated file Show diff for this revision Revisions of this file
Classes/RobotMVC/RobotModel.cpp Show annotated file Show diff for this revision Revisions of this file
Classes/RobotMVC/RobotView.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 4173e6b7adde -r ee2b617cc0e6 Classes/RobotMVC/RobotController.cpp
--- a/Classes/RobotMVC/RobotController.cpp	Thu May 11 15:40:01 2017 +0000
+++ b/Classes/RobotMVC/RobotController.cpp	Thu May 11 16:20:54 2017 +0000
@@ -62,7 +62,7 @@
             }
             return;
         case 2://Line Follower
-        case 3://Object Avoidance
+        case 3://Object Following
         case 4://Light Avoidance
         case 5://TV Remote Control
         case 6://Wiimote Control
@@ -104,9 +104,9 @@
             sprintf (buffer, "%d", info);
             view->writeString(buffer,18);
             break;
-        case 3://Object Avoidance
+        case 3://Object Following
             sprintf (buffer, "%d", info);
-            view->writeString(buffer, 15);
+            view->writeString(buffer, 14);
             break;
         case 4://Light Avoidance
             sprintf (buffer, "L %d    R %d", model->checkLight(0), model->checkLight(1));  
diff -r 4173e6b7adde -r ee2b617cc0e6 Classes/RobotMVC/RobotModel.cpp
--- a/Classes/RobotMVC/RobotModel.cpp	Thu May 11 15:40:01 2017 +0000
+++ b/Classes/RobotMVC/RobotModel.cpp	Thu May 11 16:20:54 2017 +0000
@@ -269,7 +269,7 @@
             LeftMotor.speed(speedRight);
             RightMotor.speed(speedLeft*0.5f);
             return (int)(p*100);
-            //OA
+            //OF
         case 3:
             //sonar_t.reset();
 //            //ping sensor
@@ -282,8 +282,9 @@
 //            sonar_t.stop();
 //            float time_us = sonar_t.read_us();
             float volts = echo.read();
-            if(volts >= .7){
-                TurnRight();
+            if(volts <= .4){
+                LeftMotor.speed(.15);
+                RightMotor.speed(-.15);
             }else{
                 DriveStraight();
             }
diff -r 4173e6b7adde -r ee2b617cc0e6 Classes/RobotMVC/RobotView.cpp
--- a/Classes/RobotMVC/RobotView.cpp	Thu May 11 15:40:01 2017 +0000
+++ b/Classes/RobotMVC/RobotView.cpp	Thu May 11 16:20:54 2017 +0000
@@ -54,7 +54,7 @@
             _lcd.DisplayStringAt(0, LINE(1), (uint8_t *)"Configurable Robot", CENTER_MODE);
             _lcd.DisplayStringAt(0, LINE(2), (uint8_t *)"University of Oklahoma", CENTER_MODE);
             _lcd.DisplayStringAt(0, LINE(5), (uint8_t *)"Line Follower", CENTER_MODE);
-            _lcd.DisplayStringAt(0, LINE(8), (uint8_t *)"Object Avoidance", CENTER_MODE);
+            _lcd.DisplayStringAt(0, LINE(8), (uint8_t *)"Object Following", CENTER_MODE);
             _lcd.DisplayStringAt(0, LINE(11), (uint8_t *)"Light Avoidance", CENTER_MODE);
             _lcd.DisplayStringAt(0, LINE(14), (uint8_t *)"TV Remote Control(Drive Forward)", CENTER_MODE);
             _lcd.DisplayStringAt(0, LINE(17), (uint8_t *)"Wiimote Control(Drive in Square)", CENTER_MODE);
@@ -66,10 +66,10 @@
             _lcd.DisplayStringAt(0, LINE(14), (uint8_t *)"UNDER CONSTRUCTION", CENTER_MODE);
             _infoline=14;
             break;
-        case 3://Object Avoidance
+        case 3://Object Following
             _lcd.DisplayStringAt(0, LINE(1), (uint8_t *)"Configurable Robot", CENTER_MODE);
             _lcd.DisplayStringAt(0, LINE(2), (uint8_t *)"University of Oklahoma", CENTER_MODE);
-            _lcd.DisplayStringAt(0, LINE(11), (uint8_t *)"Object Avoidance", CENTER_MODE);
+            _lcd.DisplayStringAt(0, LINE(11), (uint8_t *)"Object Following", CENTER_MODE);
             _lcd.DisplayStringAt(0, LINE(14), (uint8_t *)"UNDER CONSTRUCTION", CENTER_MODE);
             _infoline=14;
             break;
@@ -156,7 +156,7 @@
             else
                 return 5;
         case 2://Line Following
-        case 3://Object Avoidance
+        case 3://Object Following
         case 4://Light Avoidance
         case 5://TV Remote Control
         case 6://Wiimote Control