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