Project

General

Profile

Statistics
| Revision:

root / trunk / code / projects / diagnostic_station / station / test_rangefinders.c @ 1205

History | View | Annotate | Download (839 Bytes)

1
#include "test_rangefinders.h"
2
#include "global.h"
3

    
4
#include "hardware.h"
5

    
6
#include "comm_robot.h"
7

    
8

    
9
void test_rangefinder (uint8_t num)
10
{
11
        if (num>4) return;
12
        
13
        usb_puts("# Testing rangefinder ");
14
        usb_puti(num);
15
        usb_puts(NL);
16
        
17
        //        rotate to position
18
        //        
19
        for (uint8_t direction=1; direction<=2; ++direction)
20
        {
21
        //        for (wall positions up/down)
22
        //        {
23
        //                set wall position
24
        //                send (read)
25
        //                receive (data)
26
        //        }
27

    
28
                // Send data
29
                usb_puts ("data rangefinder ");
30
                usb_puti (num);
31
                usb_puts (" ");
32
                usb_puts (wall_direction_string (direction));
33
                usb_puts (" 1/1 2/2 3/3 4/4 5/5 6/6 7/7 8/8" NL);
34
        }
35
}
36

    
37

    
38
void test_rangefinder_all (void)
39
{
40
        usb_puts("# Testing rangefinders" NL);
41
        
42
        for (int n=0; n<5; ++n)
43
                test_rangefinder (n);
44
        
45
        usb_puts("# Testing rangefinders finished" NL);
46
}