Project

General

Profile

Statistics
| Revision:

root / trunk / code / projects / diagnostic_station / station / dump_robot.c @ 1279

History | View | Annotate | Download (1.35 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
        // TODO implement resetting the encoders (r key, for example)
15
        while (usb_getc_nb (&c)==-1)
16
        {
17
                robot_read_encoders (&left, &right);
18
                
19
                usb_puts ("Left:  "); usb_puti (left ); usb_puts (NL);
20
                usb_puts ("Right: "); usb_puti (right); usb_puts (NL);
21
                usb_puts (NL NL);
22
        }
23
}
24

    
25
void dump_robot_rangefinders (void)
26
{
27
        uint16_t rf[5];
28
        char c;
29

    
30
        while (usb_getc_nb (&c)==-1)
31
        {
32
                // First read all of the values, then print them, because it's much more readable that way.
33

    
34
                for (uint8_t i=0; i<5; ++i)
35
                {
36
                        robot_read_rangefinder (i, &rf[i]);
37
                }
38

    
39
                for (uint8_t i=0; i<5; ++i)
40
                {
41
                        usb_puti (i);
42
                        usb_puts (": ");
43
                        usb_puti (rf[i]);
44
                        usb_puts (NL);
45
                }
46

    
47
                usb_puts (NL NL);
48
        }
49
}
50

    
51
void dump_robot_bom (void)
52
{
53
        uint16_t bom[16];
54
        char c;
55
        
56
        while (usb_getc_nb (&c)==-1)
57
        {
58
                // First read all of the values, then print them, because it's much more readable that way.
59
                
60
                for (uint8_t i=0; i<16; ++i)
61
                        robot_read_bom (i, &bom[i]);
62
                //robot_read_bom_all (bom);
63

    
64
                for (uint8_t i=0; i<16; ++i)
65
                {
66
                        if (i<10) usb_puts (" ");
67
                        usb_puti (i);
68
                        usb_puts (": ");
69
                        usb_puti (bom[i]);
70
                        usb_puts (NL);
71
                }
72
                usb_puts (NL NL);
73
        }
74
}