Project

General

Profile

Statistics
| Revision:

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

History | View | Annotate | Download (1.52 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
        while (usb_getc_nb (&c)==-1)
13
        {
14
                dynamos_read (&left, &right);
15
                
16
                usb_puts ("Left: "); usb_puti (left ); usb_puts (NL);
17
                usb_puts ("Right:"); usb_puti (right); usb_puts (NL);
18
                usb_puts (NL NL);
19

    
20
                delay_ms (100);
21
        }
22
}
23

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

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

    
35
                delay_ms (100);
36
        }
37
}
38

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

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

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

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

    
69
                delay_ms (100);
70
        }
71
}
72

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

    
89
                delay_ms (delay);
90
        }
91
}