Project

General

Profile

Statistics
| Revision:

root / trunk / code / projects / test / test_analog.c @ 1401

History | View | Annotate | Download (604 Bytes)

1
#include <dragonfly_lib.h>
2

    
3
/*
4
 * This function outputs to TeraTerm a table which displays the values currently
5
 * stored in the analog table
6
 */
7

    
8
int testanalog(void) {
9

    
10
        
11
        usb_init();
12
        usb_puts("usb turned on\r\n");
13
        
14
        range_init();
15
        usb_puts("rangefinders initialized\r\n");
16
        
17
        usb_puts("\r\n\n");
18
        delay_ms(1000);
19
        
20
        while (1) {
21
        
22
                for (int i = 0; i < 20; i++) {
23
                
24
                        usb_puts("\r\n");
25
                
26
                }
27
                
28
                usb_puts("port# |\tvalue\r\n");
29
                
30
                for (int j = 1; j < 16; j++) {
31
                
32
                        usb_puti(j);
33
                        usb_puts("\t");
34
                        usb_puti(analog10(j));
35
                        usb_puts("\r\n");
36
                
37
                }
38
                
39
                delay_ms(575);
40
                
41
        }
42
        
43
        return 0;
44
}