Revision 1136
Includes code to sample all analog inputs. Used to determine which ports the inverse BOM are connected to.
trunk/code/projects/diagnostic_station/stationCode/v1/main.c | ||
---|---|---|
3 | 3 |
|
4 | 4 |
int main(void) |
5 | 5 |
{ |
6 |
char buf[5]; |
|
6 |
char buf[16]; |
|
7 |
int i; |
|
7 | 8 |
|
8 | 9 |
/* initialize components */ |
9 | 10 |
sei(); |
... | ... | |
17 | 18 |
|
18 | 19 |
while(1) { |
19 | 20 |
|
20 |
usb_puts("port:\t\tval:"); |
|
21 |
usb_puts(itoa(WHEEL_PORT, buf, 10)); |
|
22 |
usb_puts("\tvalue: "); |
|
23 |
usb_puts(itoa(analog_get8(WHEEL_PORT), buf, 10)); |
|
24 |
usb_puts("\n"); |
|
21 |
usb_puts("port:\t\tval:\n\n"); |
|
22 |
|
|
23 |
for (i = 0; i < 0x10; i++) { |
|
24 |
|
|
25 |
usb_puts(itoa(i, buf, 10)); |
|
26 |
usb_puts("\t\t"); |
|
27 |
usb_puts(itoa(analog_get10(i), buf, 10)); |
|
28 |
usb_puts("\n"); |
|
29 |
|
|
30 |
} |
|
31 |
|
|
25 | 32 |
delay_ms(100); |
26 | 33 |
} |
27 | 34 |
|
35 |
exit(1); /* Control never reaches this point */ |
|
36 |
|
|
28 | 37 |
} |
Also available in: Unified diff