3/26/16 12:25 am JJ

Dependents:   steppertest R5 2016 Robotics Team 1

Fork of scanner by David Vasquez

Revision:
10:6a630acaeadb
Parent:
8:32a445ae1d72
Child:
11:c6152a32a104
--- a/scanner.cpp	Sat Mar 26 05:26:17 2016 +0000
+++ b/scanner.cpp	Sat Mar 26 16:51:33 2016 +0000
@@ -37,9 +37,11 @@
     distForwardL = 0.0;
     distForwardR = 0.0;
 
-    // initializing to avoid status
-    avoidFlag = 1;
+    // initializing to localizeRight status
+    avoidFlag = 0;
     huntFlag = 0;
+    localizeRightFlag = 1;
+    localizeLeftFlag = 0;
     invertL = -1;
     invertR = 1;
     dutyL = MAX_DUTY;
@@ -275,6 +277,12 @@
 {
     if (pitEnable == 1)
     {
+        if (localizeRightFlag == 1)
+            localizeRight();
+        
+        if (localizeLeftFlag == 1)
+            localizeLeft();
+        
         /*// obtain distance measures from sensors
         distLeft = longRangeL.distInchesL();
         distRight = longRangeR.distInchesR();
@@ -292,7 +300,7 @@
         {
             // add hunt code
         }*/
-
+/*
         // increment/decrement servo position
         dutyL += invertL;
         dutyR += invertR;
@@ -303,6 +311,6 @@
         {
             invertL *= -1;
             invertR *= -1;
-        }
+        }*/
     }
 }