Revision 1246
Implemented all robot sensor dump functions
trunk/code/projects/diagnostic_station/station/dump_robot.c | ||
---|---|---|
21 | 21 |
usb_puts (NL); |
22 | 22 |
} |
23 | 23 |
} |
24 |
|
|
25 |
void dump_robot_rangefinders (void) |
|
26 |
{ |
|
27 |
uint16_t rf; |
|
28 |
char c; |
|
29 |
|
|
30 |
while (usb_getc_nb (&c)==-1) |
|
31 |
{ |
|
32 |
for (uint8_t i=0; i<5; ++i) |
|
33 |
{ |
|
34 |
robot_read_rangefinder (i, &rf); |
|
35 |
if (i!=0) usb_puts (" "); |
|
36 |
usb_puti (rf); |
|
37 |
} |
|
38 |
usb_puts (NL); |
|
39 |
} |
|
40 |
} |
|
41 |
|
|
42 |
void dump_robot_bom (void) |
|
43 |
{ |
|
44 |
uint16_t bom; |
|
45 |
char c; |
|
46 |
|
|
47 |
while (usb_getc_nb (&c)==-1) |
|
48 |
{ |
|
49 |
for (uint8_t i=0; i<16; ++i) |
|
50 |
{ |
|
51 |
robot_read_rangefinder (i, &bom); |
|
52 |
if (i!=0) usb_puts (" "); |
|
53 |
usb_puti (bom); |
|
54 |
} |
|
55 |
usb_puts (NL); |
|
56 |
} |
|
57 |
} |
trunk/code/projects/diagnostic_station/station/dump_robot.h | ||
---|---|---|
2 | 2 |
#define _dump_robot_h |
3 | 3 |
|
4 | 4 |
void dump_robot_encoders (void); |
5 |
void dump_robot_rangefinders (void); |
|
6 |
void dump_robot_bom (void); |
|
5 | 7 |
|
6 | 8 |
|
7 | 9 |
|
trunk/code/projects/diagnostic_station/station/comm_interactive.c | ||
---|---|---|
11 | 11 |
|
12 | 12 |
#define ESC 27 |
13 | 13 |
|
14 |
/* |
|
15 |
Main menu: (t)ests, (s)tation sensors, (r)obot sensors |
|
16 |
Tests menu: (b)om, (r)angefindrs, (e)ncoders, (m)otors |
|
17 |
Station sensors menu: (e)ncoders, (w)all, (t)urntable |
|
18 |
Robot sensors menu: (e)ncoders, (b)om, (r)angefinders |
|
19 |
*/ |
|
20 |
|
|
21 | 14 |
void station_sensors_menu (void) |
22 | 15 |
{ |
23 | 16 |
while (1) |
24 | 17 |
{ |
25 |
usb_puts ("# Station sensors menu: (e)ncoders, (w)all, (t)urntable, (r)bom" NL);
|
|
18 |
usb_puts ("# Dump station sensors menu: (e)ncoders, (w)all, (t)urntable, (r)bom" NL);
|
|
26 | 19 |
|
27 | 20 |
char choice = usb_getc (); |
28 | 21 |
switch (choice) { |
... | ... | |
40 | 33 |
{ |
41 | 34 |
while (1) |
42 | 35 |
{ |
43 |
usb_puts ("# Robot sensors menu: (e)ncoders" NL);
|
|
36 |
usb_puts ("# Dump robot sensors menu: (e)ncoders, (r)angefinders, (b)om" NL);
|
|
44 | 37 |
|
45 | 38 |
char choice = usb_getc (); |
46 | 39 |
switch (choice) { |
47 |
case 'e': case 'E': dump_robot_encoders (); break; |
|
40 |
case 'e': case 'E': dump_robot_encoders (); break; |
|
41 |
case 'r': case 'R': dump_robot_rangefinders (); break; |
|
42 |
case 'b': case 'B': dump_robot_bom (); break; |
|
48 | 43 |
case ESC: return; |
49 | 44 |
default: break; |
50 | 45 |
} |
... | ... | |
76 | 71 |
{ |
77 | 72 |
while (1) |
78 | 73 |
{ |
79 |
usb_puts ("# Main menu: (t)ests, (s)tation sensors, (r)obot sensors" NL);
|
|
74 |
usb_puts ("# Main menu: (t)ests, dump (s)tation sensors, dump (r)obot sensors" NL);
|
|
80 | 75 |
|
81 | 76 |
char choice = usb_getc (); |
82 | 77 |
switch (choice) { |
Also available in: Unified diff