root / branches / autonomous_recharging / code / projects / autonomous_recharging / dragonfly / main.c @ 340
History | View | Annotate | Download (642 Bytes)
1 |
#include <dragonfly_lib.h> |
---|---|
2 |
#include <wireless.h> |
3 |
#include <wl_token_ring.h> |
4 |
#include <rangefinder.h> |
5 |
#include "smart_run_around_fsm.h" |
6 |
|
7 |
#include "recharge.h" |
8 |
|
9 |
void do_nothing2(void) {} |
10 |
int get_nothing2(void) {return 0;} |
11 |
|
12 |
int main(void) |
13 |
{ |
14 |
dragonfly_init(ALL_ON); |
15 |
range_init(); |
16 |
orb_enable(); |
17 |
usb_puts("Turned on!\n");
|
18 |
wl_init(); |
19 |
usb_puts("Wireless initialized!\n");
|
20 |
wl_set_channel(0xE);
|
21 |
wl_token_ring_register(); |
22 |
wl_token_ring_join(); |
23 |
recharge_init(); |
24 |
usb_puts("Recharging initialized.\n");
|
25 |
run_around_init(); |
26 |
while (1) |
27 |
{ |
28 |
wl_do(); |
29 |
int charging = recharge_do();
|
30 |
if (!charging)
|
31 |
{ |
32 |
run_around_FSM(); |
33 |
} |
34 |
} |
35 |
|
36 |
return 0; |
37 |
} |
38 |
|