Scanner code will include the following: obstacle avoidance, hunting for victims, and localization checks.

Revision:
3:992558a021d7
Parent:
2:b281034eda86
Child:
4:6a8d80954323
--- a/scanner.h	Tue Feb 23 23:35:41 2016 +0000
+++ b/scanner.h	Mon Mar 21 01:32:09 2016 +0000
@@ -10,9 +10,12 @@
     Scanner(Serial &pc1, PinName _servoL, PinName _servoR,
     VL6180x &_shortRangeL, VL6180x &_shortRangeR, Gp2x &_longRangeL,
     Gp2x &_longRangeR, float _period = 0.2);
-    void hunt();
-    void avoid();
-    int localize();
+    void huntMode();
+    void avoidMode();
+    void localize();
+    float getDistLeft() {return distLeft;}
+    float getDistRight() {return distRight;}
+    float getDistForward() {return distForward;}
 
 private:
     static const int MIN_DUTY = 0;
@@ -27,6 +30,9 @@
     int invertR;
     int dutyL;
     int dutyR;
+    float distLeft;
+    float distRight;
+    float distForward;
     Serial &pc;
     PwmOut servoL;
     PwmOut servoR;
@@ -35,11 +41,14 @@
     Gp2x &longRangeL;
     Gp2x &longRangeR;
     float period;
+    bool obstacle;
+    bool huntFlag;
+    bool avoidFlag;
 
-    Ticker pit; // periodic interrupt timer
+    Ticker scanPit; // periodic interrupt timer
 
     void scan();
 
 };
 
-#endif // SCANNER_H
\ No newline at end of file
+#endif // SCANNER_H