Project

General

Profile

Statistics
| Revision:

root / branches / analog / trunk / code / projects / template / main.c @ 331

History | View | Annotate | Download (610 Bytes)

1 300 kwoo
#include "../libdragonfly/dragonfly_lib.h"
2 16 bcoltin
3 156 emarinel
int main(void) {
4 331 cmar
        unsigned int count = 0;
5 312 kwoo
        int count2 = 0;
6 16 bcoltin
        dragonfly_init(ALL_ON);
7 331 cmar
        range_init();
8
        //analog_stop_loop();
9
        usb_puts("starting");
10 300 kwoo
        while (1) {
11 331 cmar
                if (count == 50000) {
12
                        for(int i=2; i<7; i++) {
13
                                usb_puti( linearize_distance(analog8(i)) );
14
                                usb_puts("  ");
15
                        }
16 312 kwoo
                        usb_puts("\n\r");
17
                        count = 0;
18
                }
19 331 cmar
                /*
20 312 kwoo
                if (count2 == 5000) {
21
                        usb_puts("Loop stopped\n\r");
22
                        analog_stop_loop();
23
                }
24

25
                if (count2 == 10000) {
26
                        usb_puts("Loop started\n\r");
27
                        analog_start_loop();
28
                        count2 = 0;
29 331 cmar
                }*/
30 312 kwoo
31
32
                count++;
33 331 cmar
                //count2++;
34 300 kwoo
        }
35
36 16 bcoltin
        return 0;
37
}