Revision 1205
Implemented single encoder testing
Cleaned up motor direction/wall direction naming
test_rangefinders.c | ||
---|---|---|
1 | 1 |
#include "test_rangefinders.h" |
2 | 2 |
#include "global.h" |
3 | 3 |
|
4 |
#include "hardware.h" |
|
5 |
|
|
4 | 6 |
#include "comm_robot.h" |
5 | 7 |
|
6 |
static char *direction_string (uint8_t direction) |
|
7 |
{ |
|
8 |
if (direction==1) |
|
9 |
return "out"; |
|
10 |
else if (direction==2) |
|
11 |
return "in"; |
|
12 |
else |
|
13 |
return "?"; |
|
14 |
} |
|
15 | 8 |
|
16 |
|
|
17 | 9 |
void test_rangefinder (uint8_t num) |
18 | 10 |
{ |
19 | 11 |
if (num>4) return; |
... | ... | |
37 | 29 |
usb_puts ("data rangefinder "); |
38 | 30 |
usb_puti (num); |
39 | 31 |
usb_puts (" "); |
40 |
usb_puts (direction_string (direction)); |
|
32 |
usb_puts (wall_direction_string (direction));
|
|
41 | 33 |
usb_puts (" 1/1 2/2 3/3 4/4 5/5 6/6 7/7 8/8" NL); |
42 | 34 |
} |
43 | 35 |
} |
Also available in: Unified diff