Revision 198
Recharging updated.
departing.c | ||
---|---|---|
19 | 19 |
* The counter for when we are done leaving the station. |
20 | 20 |
**/ |
21 | 21 |
int leave_station_count = 0; |
22 |
|
|
22 |
int old_distance = -1; |
|
23 | 23 |
/** |
24 | 24 |
* Leaves the charging station. The robot will |
25 | 25 |
* continue to back up until it collides with |
... | ... | |
33 | 33 |
{ |
34 | 34 |
//TODO: use rangefinders to depart |
35 | 35 |
int front_distance = range_read_distance(IR2); |
36 |
//RECHARGE_DEBUG_PUTI(front_distance); |
|
37 |
//RECHARGE_DEBUG_PRINT("\n"); |
|
38 | 36 |
|
39 | 37 |
if(front_distance != -1 && front_distance < 160) |
40 | 38 |
leave_station_count++; |
41 | 39 |
else |
42 | 40 |
leave_station_count = 0; |
43 | 41 |
|
44 |
if(leave_station_count > 1000)
|
|
42 |
if(leave_station_count > 10) |
|
45 | 43 |
{ |
46 | 44 |
//stop |
47 | 45 |
move(0,0); |
Also available in: Unified diff