PickBeeperToWall

Dependencies:   HCSR

Revision:
6:267f417dbce0
Parent:
5:6b667e2cb800
--- a/ur_Bertl.cpp	Fri Apr 10 07:12:07 2015 +0000
+++ b/ur_Bertl.cpp	Thu Apr 16 11:50:01 2015 +0000
@@ -63,6 +63,31 @@
     wait_ms(250);
 }
 
+void ur_Bertl :: Back()
+{
+    int count = _count;
+    MotorR_EN=MotorL_EN=1;                  // both motor ENABLE
+    MotorR_REVERSE = MotorL_REVERSE = 1;    // both motor forward ON
+#ifdef TIME
+    wait_ms(MOVE);
+#else
+
+    while(_count < count+DISTANCE) {
+        //if(!FrontIsClear())       // more convenient because there are no accidents :-)
+          //  break;
+#ifdef FRONTBUTTON
+        if(frontButtonPressed())
+            error();
+#endif
+        DEBUG_PRINT("count: %d _count: %d", count, _count);
+    }
+#endif
+    MotorR_REVERSE = MotorL_REVERSE = 0;    // both motor off
+    MotorR_EN=MotorL_EN=0;
+    wait_ms(250);
+}
+
+
 void ur_Bertl::PutBeeper()
 {
 //    wait_ms(500);