Project

General

Profile

Statistics
| Revision:

root / branches / autonomous_recharging / code / projects / autonomous_recharging / dragonfly / main.c @ 213

History | View | Annotate | Download (776 Bytes)

1 105 bcoltin
#include <dragonfly_lib.h>
2 116 bcoltin
#include <wireless.h>
3
#include <wl_token_ring.h>
4 198 bcoltin
#include <rangefinder.h>
5 213 bcoltin
#include "smart_run_around_fsm.h"
6 105 bcoltin
7 116 bcoltin
#include "recharge.h"
8
9 213 bcoltin
void do_nothing2(void) {}
10
int get_nothing2(void) {return 0;}
11
12 105 bcoltin
int main(void)
13
{
14 138 bcoltin
        dragonfly_init(ALL_ON);
15 116 bcoltin
        usb_puts("Initializing wireless.\n");
16 198 bcoltin
        range_init();
17
        orb_enable();
18 116 bcoltin
        wl_init();
19 210 bcoltin
        wl_set_channel(0xA);
20 137 bcoltin
        //orb_set_color(YELLOW);
21 116 bcoltin
        wl_token_ring_register();
22 213 bcoltin
        wl_token_ring_set_bom_functions(do_nothing2, do_nothing2, get_nothing2);
23 116 bcoltin
        wl_token_ring_join();
24
        usb_puts("Wireless initialized.\n");
25
        recharge_init();
26
        usb_puts("Recharging initialized.\n");
27 213 bcoltin
        //run_around_init();
28 116 bcoltin
        while (1)
29
        {
30
                wl_do();
31
                int charging = recharge_do();
32
                if (!charging)
33
                {
34 213 bcoltin
                        analog8(IR5);
35
                        //run_around_FSM();
36 116 bcoltin
                }
37
        }
38
39 105 bcoltin
        return 0;
40
}