root / trunk / code / projects / test / testanalog.c @ 827
History | View | Annotate | Download (477 Bytes)
1 |
#include <dragonfly_lib.h> |
---|---|
2 |
|
3 |
int testanalog(void) { |
4 |
|
5 |
dragonfly_init(ANALOG); |
6 |
usb_init(); |
7 |
usb_puts("usb turned on\r\n");
|
8 |
delay_ms(1000);
|
9 |
|
10 |
while (1) { |
11 |
|
12 |
//Cycle through the table and print out values *start one port above BOM
|
13 |
for (int i = 1; i < 16; i++) { |
14 |
|
15 |
usb_puts("port ");
|
16 |
usb_puti(i); |
17 |
usb_puts(":");
|
18 |
|
19 |
//Print value
|
20 |
usb_puti(analog10(i)); |
21 |
|
22 |
//Spacing
|
23 |
usb_puts("\t");
|
24 |
|
25 |
} |
26 |
|
27 |
//New Line
|
28 |
usb_puts("\r\n");
|
29 |
|
30 |
} |
31 |
|
32 |
return 0; |
33 |
} |