Revision 126
Fixed problems with motors, error in charging station delay_ms for BOM.
branches/autonomous_recharging/code/projects/autonomous_recharging/charging_station/wl_defs.h | ||
---|---|---|
22 | 22 |
#define WL_TOKEN_JOIN_ACCEPT 6 |
23 | 23 |
|
24 | 24 |
// timing constants |
25 |
#define BOM_DELAY 100
|
|
25 |
#define BOM_DELAY 200
|
|
26 | 26 |
#define DEATH_DELAY 3 |
27 | 27 |
#define JOIN_DELAY 8 |
28 | 28 |
|
branches/autonomous_recharging/code/projects/autonomous_recharging/dragonfly/recharge.c | ||
---|---|---|
2 | 2 |
#include <battery.h> |
3 | 3 |
#include <dio.h> |
4 | 4 |
#include <lights.h> |
5 |
#include <motor.h> |
|
6 |
#include <serial.h> |
|
5 | 7 |
|
6 | 8 |
#include <wl_defs.h> |
7 | 9 |
#include "wl_recharge_group.h" |
... | ... | |
29 | 31 |
{ |
30 | 32 |
wl_recharge_register(); |
31 | 33 |
//TODO: uncomment to use homing sensor |
32 |
//recharge_i2c_init();
|
|
34 |
recharge_i2c_init(); |
|
33 | 35 |
} |
34 | 36 |
|
35 | 37 |
/** |
... | ... | |
166 | 168 |
//TODO: implement |
167 | 169 |
//if (battery is charged) |
168 | 170 |
if (button2_click()) |
171 |
{ |
|
172 |
motors_off(); |
|
169 | 173 |
wl_recharge_depart(); |
174 |
} |
|
170 | 175 |
} |
171 | 176 |
|
172 | 177 |
/** |
branches/autonomous_recharging/code/projects/autonomous_recharging/dragonfly/seeking.c | ||
---|---|---|
11 | 11 |
#define SEEK_WITH_BOM 1 |
12 | 12 |
#define SEEK_WITH_HOMING 2 |
13 | 13 |
|
14 |
#define SEEKING_BOM_VELOCITY -160
|
|
14 |
#define SEEKING_BOM_VELOCITY -170
|
|
15 | 15 |
#define SEEKING_HOMING_VELOCITY -160 |
16 | 16 |
|
17 | 17 |
// values for homing sensor readings |
... | ... | |
66 | 66 |
v = SEEKING_BOM_VELOCITY_TURN; |
67 | 67 |
*/ |
68 | 68 |
//TODO: uncomment this line |
69 |
move_avoid(v, w, 5);
|
|
69 |
move(v, w);
|
|
70 | 70 |
} |
71 | 71 |
|
72 | 72 |
//data is fresh, use it |
73 | 73 |
//TODO: uncomment to use homing sensor |
74 |
/*int widthcount = recharge_i2c_get_homing_reading();
|
|
74 |
int widthcount = recharge_i2c_get_homing_reading(); |
|
75 | 75 |
|
76 | 76 |
if(widthcount>= 4) |
77 |
return SEEK_WITH_HOMING;*/
|
|
77 |
return SEEK_WITH_HOMING; |
|
78 | 78 |
return SEEK_WITH_BOM; |
79 | 79 |
} |
80 | 80 |
|
branches/autonomous_recharging/code/projects/autonomous_recharging/dragonfly/Makefile | ||
---|---|---|
15 | 15 |
USE_WIRELESS = 1 |
16 | 16 |
|
17 | 17 |
# com1 = serial port. Use lpt1 to connect to parallel port. |
18 |
AVRDUDE_PORT = /dev/ttyUSB2
|
|
18 |
AVRDUDE_PORT = /dev/ttyUSB0
|
|
19 | 19 |
# |
20 | 20 |
# |
21 | 21 |
################################### |
Also available in: Unified diff