Project

General

Profile

Statistics
| Revision:

root / trunk / code / projects / diagnostic_station / station / dump_station.c @ 1293

History | View | Annotate | Download (1.58 KB)

1
#include "dump_station.h"
2

    
3
#include "hardware.h"
4

    
5
void dump_station_dynamos (void)
6
{
7
        int16_t left, right;
8
        char c;
9

    
10
        dynamos_reset ();
11

    
12
        // TODO implement resetting the dynamos (r key, for example)
13
        
14
        while (usb_getc_nb (&c)==-1)
15
        {
16
                dynamos_read (&left, &right);
17
                
18
                usb_puts ("Left: "); usb_puti (left ); usb_puts (NL);
19
                usb_puts ("Right:"); usb_puti (right); usb_puts (NL);
20
                usb_puts (NL NL);
21

    
22
                delay_ms (100);
23
        }
24
}
25

    
26
void dump_station_turntable (void)
27
{
28
        uint16_t turntable;
29
        char c;
30

    
31
        while (usb_getc_nb (&c)==-1)
32
        {
33
                turntable=turntable_get_position ();
34
                usb_puti (turntable);
35
                usb_puts (NL);
36

    
37
                delay_ms (100);
38
        }
39
}
40

    
41
void dump_station_wall (void)
42
{
43
        uint16_t wall;
44
        char c;
45

    
46
        while (usb_getc_nb (&c)==-1)
47
        {
48
                wall=turntable_get_position ();
49
                usb_puti (wall);
50
                usb_puts (NL);
51
                
52
                delay_ms (100);
53
        }
54
}
55

    
56
void dump_station_ibom (void)
57
{
58
        uint16_t top, left, right;
59
        char c;
60

    
61
        while (usb_getc_nb (&c)==-1)
62
        {
63
                ibom_update ();
64
                ibom_read (&top, &left, &right);
65
                
66
                usb_puts ("Top:   "); usb_puti (top  ); usb_puts (NL);
67
                usb_puts ("Left:  "); usb_puti (left ); usb_puts (NL);
68
                usb_puts ("Right: "); usb_puti (right); usb_puts (NL);
69
                usb_puts (NL NL);
70

    
71
                delay_ms (100);
72
        }
73
}
74

    
75
void dump_station_adc (uint8_t startPort, uint8_t endPort, uint16_t delay)
76
{
77
        char c;
78
        
79
        while (usb_getc_nb (&c)==-1)
80
        {
81
                for (uint8_t i=startPort; i<=endPort; ++i)
82
                {
83
                        if (i<10) usb_puts (" ");
84
                        usb_puti (i);
85
                        usb_puts (": ");
86
                        usb_puti (analog10 (i));
87
                        usb_puts (NL);
88
                }
89
                usb_puts(NL NL);
90

    
91
                delay_ms (delay);
92
        }
93
}