Project

General

Profile

Statistics
| Revision:

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

History | View | Annotate | Download (909 Bytes)

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
                usb_puti (left);
19
                usb_puts (" ");
20
                usb_puti (right);
21
                usb_puts (NL);
22
        }
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
}