Project

General

Profile

Statistics
| Revision:

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

History | View | Annotate | Download (1.56 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
        // TODO implement resetting the dynamos (r key, for example)
11
        while (usb_getc_nb (&c)==-1)
12
        {
13
                dynamos_read (&left, &right);
14
                
15
                usb_puts ("Left: "); usb_puti (left ); usb_puts (NL);
16
                usb_puts ("Right:"); usb_puti (right); usb_puts (NL);
17
                usb_puts (NL NL);
18

    
19
                delay_ms (100);
20
        }
21
}
22

    
23
void dump_station_turntable (void)
24
{
25
        uint16_t turntable;
26
        char c;
27

    
28
        while (usb_getc_nb (&c)==-1)
29
        {
30
                turntable=turntable_get_position ();
31
                usb_puti (turntable);
32
                usb_puts (NL);
33

    
34
                delay_ms (100);
35
        }
36
}
37

    
38
void dump_station_wall (void)
39
{
40
        uint16_t wall;
41
        char c;
42

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

    
53
void dump_station_ibom (void)
54
{
55
        uint16_t top, left, right;
56
        char c;
57

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

    
68
                delay_ms (100);
69
        }
70
}
71

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

    
88
                delay_ms (delay);
89
        }
90
}