Project

General

Profile

Statistics
| Revision:

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

History | View | Annotate | Download (611 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
#include "recharge.h"
7

    
8
void do_nothing2(void) {}
9
int get_nothing2(void) {return 0;}
10

    
11
int main(void)
12
{
13
        dragonfly_init(ALL_ON);
14
        usb_puts("Turned on!\n");
15
        wl_init();
16
        usb_puts("Wireless initialized!\n");
17
        wl_set_channel(0xE);
18
        wl_token_ring_register();
19
        wl_token_ring_join();
20
        recharge_init();
21
        usb_puts("Recharging initialized.\n");
22
        run_around_init();
23
        while (1)
24
        {
25
                wl_do();
26
                int charging = recharge_do();
27
                if (!charging)
28
                {
29
                        run_around_FSM();
30
                }
31
        }
32
        
33
        return 0;
34
}
35