root / trunk / code / behaviors / orbit_fsm / driver.c @ 1509
History | View | Annotate | Download (721 Bytes)
1 | 672 | dsschult | /** driver for orbit code
|
---|---|---|---|
2 | execute orbit behavior
|
||
3 | */
|
||
4 | |||
5 | #include <dragonfly_lib.h> |
||
6 | #include <wireless.h> |
||
7 | #include <wl_token_ring.h> |
||
8 | #include "orbit_fsm.h" |
||
9 | |||
10 | |||
11 | int main(void) { |
||
12 | // enable everything
|
||
13 | dragonfly_init(ALL_ON); |
||
14 | orb_enable(); |
||
15 | orb_init(); |
||
16 | orb_set_color(PURPLE); |
||
17 | wl_init(); |
||
18 | wl_set_channel("O");
|
||
19 | wl_token_ring_register(); |
||
20 | wl_token_ring_join(); // join token ring
|
||
21 | |||
22 | /*int robot = -1;
|
||
23 | wl_token_iterator_begin();
|
||
24 | while(wl_token_iterator_has_next() && robot == -1) {
|
||
25 | robot = wl_token_iterator_next();
|
||
26 | if (robot == wl_get_xbee_id())
|
||
27 | robot = -1; // can't orbit ourself
|
||
28 | else
|
||
29 | break;
|
||
30 | }*/
|
||
31 | |||
32 | orbit_init(1);//robot); |
||
33 | |||
34 | while(1) { |
||
35 | orbit_fsm(); // do orbit
|
||
36 | } |
||
37 | |||
38 | return 0; |
||
39 | } |