Project

General

Profile

Statistics
| Revision:

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

History | View | Annotate | Download (572 Bytes)

1
#include "../libdragonfly/dragonfly_lib.h"
2

    
3
int main(void) {
4
        int count = 0;
5
        int count2 = 0;
6
        dragonfly_init(ALL_ON);
7
        
8
        while (1) {
9
                if (count == 1000) {
10
                        usb_puts("the value of the pot is: ");
11
                        usb_puti(analog_get8(WHEEL_PORT));
12
                        usb_puts("\t");
13
                        usb_puti(analog_get10(WHEEL_PORT));
14
                        usb_puts("\n\r");
15
                        count = 0;
16
                }
17
                
18
                if (count2 == 5000) {
19
                        usb_puts("Loop stopped\n\r");
20
                        analog_stop_loop();
21
                }
22
                
23
                if (count2 == 10000) {
24
                        usb_puts("Loop started\n\r");
25
                        analog_start_loop();
26
                        count2 = 0;
27
                }
28
                
29
                
30
                count++;
31
                count2++;
32
        }
33
        
34
        return 0;
35
}