Revision 195
added more battery detection code (currently commented out for demo purposes)...also uses rangefinders for departing.
departing.c | ||
---|---|---|
32 | 32 |
int depart_station(void) |
33 | 33 |
{ |
34 | 34 |
//TODO: use rangefinders to depart |
35 |
//int front_distance = range_read_distance(IR2);
|
|
35 |
int front_distance = range_read_distance(IR2); |
|
36 | 36 |
//RECHARGE_DEBUG_PUTI(front_distance); |
37 | 37 |
//RECHARGE_DEBUG_PRINT("\n"); |
38 | 38 |
|
39 |
//if(front_distance != -1 && front_distance < 160)
|
|
39 |
if(front_distance != -1 && front_distance < 160) |
|
40 | 40 |
leave_station_count++; |
41 |
//else
|
|
42 |
// leave_station_count = 0;
|
|
41 |
else |
|
42 |
leave_station_count = 0; |
|
43 | 43 |
|
44 | 44 |
if(leave_station_count > 1000) |
45 | 45 |
{ |
Also available in: Unified diff