root / trunk / code / projects / diagnostic_station / station / dump_robot.c @ 1293
History | View | Annotate | Download (1.38 KB)
1 |
#include "dump_robot.h" |
---|---|
2 |
|
3 |
#include <dragonfly_lib.h> |
4 |
|
5 |
#include "global.h" |
6 |
#include "comm_robot.h" |
7 |
|
8 |
|
9 |
void dump_robot_encoders (void) |
10 |
{ |
11 |
int16_t left, right; |
12 |
char c;
|
13 |
|
14 |
robot_reset_encoders (); |
15 |
|
16 |
// TODO implement resetting the encoders (r key, for example)
|
17 |
while (usb_getc_nb (&c)==-1) |
18 |
{ |
19 |
robot_read_encoders (&left, &right); |
20 |
|
21 |
usb_puts ("Left: "); usb_puti (left ); usb_puts (NL);
|
22 |
usb_puts ("Right: "); usb_puti (right); usb_puts (NL);
|
23 |
usb_puts (NL NL); |
24 |
} |
25 |
} |
26 |
|
27 |
void dump_robot_rangefinders (void) |
28 |
{ |
29 |
uint16_t rf[5];
|
30 |
char c;
|
31 |
|
32 |
while (usb_getc_nb (&c)==-1) |
33 |
{ |
34 |
// First read all of the values, then print them, because it's much more readable that way.
|
35 |
|
36 |
for (uint8_t i=0; i<5; ++i) |
37 |
{ |
38 |
robot_read_rangefinder (i, &rf[i]); |
39 |
} |
40 |
|
41 |
for (uint8_t i=0; i<5; ++i) |
42 |
{ |
43 |
usb_puti (i); |
44 |
usb_puts (": ");
|
45 |
usb_puti (rf[i]); |
46 |
usb_puts (NL); |
47 |
} |
48 |
|
49 |
usb_puts (NL NL); |
50 |
} |
51 |
} |
52 |
|
53 |
void dump_robot_bom (void) |
54 |
{ |
55 |
int16_t bom[16];
|
56 |
char c;
|
57 |
|
58 |
while (usb_getc_nb (&c)==-1) |
59 |
{ |
60 |
// First read all of the values, then print them, because it's much more readable that way.
|
61 |
|
62 |
//for (uint8_t i=0; i<16; ++i)
|
63 |
//robot_read_bom (i, &bom[i]);
|
64 |
|
65 |
robot_read_bom_all (bom); |
66 |
|
67 |
for (uint8_t i=0; i<16; ++i) |
68 |
{ |
69 |
if (i<10) usb_puts (" "); |
70 |
usb_puti (i); |
71 |
usb_puts (": ");
|
72 |
usb_puti (bom[i]); |
73 |
usb_puts (NL); |
74 |
} |
75 |
usb_puts (NL NL); |
76 |
} |
77 |
} |