Revision 1117
Added code to station code version 1 to read from analog wheel port
trunk/code/projects/diagnostic_station/stationCode/v1/main.c | ||
---|---|---|
3 | 3 |
|
4 | 4 |
int main(void) |
5 | 5 |
{ |
6 |
char buf[5]; |
|
7 |
|
|
6 | 8 |
/* initialize components */ |
7 | 9 |
sei(); |
8 | 10 |
orb_init(); |
11 |
usb_init(); |
|
12 |
analog_init(ADC_START); |
|
9 | 13 |
|
10 | 14 |
orb_set(255, 0, 0); |
11 | 15 |
|
12 |
while(1); |
|
16 |
usb_puts("Yay we are on!\n"); |
|
17 |
|
|
18 |
while(1) { |
|
19 |
usb_puts("port "); |
|
20 |
usb_puts(itoa(WHEEL_PORT, buf, 10)); |
|
21 |
usb_puts("\tvalue: "); |
|
22 |
usb_puts(itoa(analog_get8(WHEEL_PORT), buf, 10)); |
|
23 |
usb_puts("\n"); |
|
24 |
delay_ms(100); |
|
25 |
} |
|
13 | 26 |
} |
Also available in: Unified diff