Project

General

Profile

Statistics
| Revision:

root / branches / wireless / code / projects / unit_tests / test_analog.c @ 1788

History | View | Annotate | Download (604 Bytes)

1 800 jsexton
#include <dragonfly_lib.h>
2
3 831 jsexton
/*
4
 * This function outputs to TeraTerm a table which displays the values currently
5
 * stored in the analog table
6
 */
7
8 800 jsexton
int testanalog(void) {
9
10 831 jsexton
11 800 jsexton
        usb_init();
12 830 jsexton
        usb_puts("usb turned on\r\n");
13 831 jsexton
14
        range_init();
15
        usb_puts("rangefinders initialized\r\n");
16
17
        usb_puts("\r\n\n");
18 827 dsschult
        delay_ms(1000);
19 800 jsexton
20
        while (1) {
21 830 jsexton
22
                for (int i = 0; i < 20; i++) {
23 800 jsexton
24 830 jsexton
                        usb_puts("\r\n");
25
26
                }
27
28 831 jsexton
                usb_puts("port# |\tvalue\r\n");
29 830 jsexton
30 831 jsexton
                for (int j = 1; j < 16; j++) {
31 800 jsexton
32 831 jsexton
                        usb_puti(j);
33
                        usb_puts("\t");
34
                        usb_puti(analog10(j));
35
                        usb_puts("\r\n");
36 830 jsexton
37 800 jsexton
                }
38
39 831 jsexton
                delay_ms(575);
40 830 jsexton
41 800 jsexton
        }
42
43
        return 0;
44
}