PickBeeperToWall
Revision 7:df6830254e8b, committed 2015-04-10
- Comitter:
- bulmecisco
- Date:
- Fri Apr 10 09:31:54 2015 +0000
- Parent:
- 5:6b667e2cb800
- Child:
- 8:e7f74f072564
- Commit message:
- Constant ULTRASONIC_DISTANCE added.
Changed in this revision
const.h | Show annotated file Show diff for this revision Revisions of this file |
ur_Bertl.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/const.h Fri Apr 10 07:12:07 2015 +0000 +++ b/const.h Fri Apr 10 09:31:54 2015 +0000 @@ -12,6 +12,10 @@ const int MOVE=500; const int TURN=500; +/*! \var int ULTRASONIC_DISTANCE +\brief Bertl Ultrasonic Distance Sensor from 1 to n; 5 is ok for nearly 5 cm. +\warning no warning*/ +const int ULTRASONIC_DISTANCE = 5; /* Distance sensor */ /*! \var int SPEED \brief Bertl speed 0.2 (slow) - 1.0 (fast). \warning speed below 0.2 possible the motor won't start */
--- a/ur_Bertl.cpp Fri Apr 10 07:12:07 2015 +0000 +++ b/ur_Bertl.cpp Fri Apr 10 09:31:54 2015 +0000 @@ -178,7 +178,7 @@ usensor.start(); wait_ms(10); dist=usensor.get_dist_cm(); - if(dist < 5) + if(dist < ULTRASONIC_DISTANCE) return false; else return true;