Revision 1202
Station/server communication:
- Implemented backspace handling
- Implemented all test starting commands with parameter
Tests:
- Added functions for testing only one component of a kind
- Made function names consistent with server commands
test_rangefinders.c | ||
---|---|---|
3 | 3 |
|
4 | 4 |
#include "comm_robot.h" |
5 | 5 |
|
6 |
void test_rangefinders (void) |
|
6 |
|
|
7 |
void test_rangefinder (uint8_t num) |
|
7 | 8 |
{ |
8 |
usb_puts("# Testing rangefinders" NL);
|
|
9 |
if (num>4) return;
|
|
9 | 10 |
|
10 |
for (int n=0; n<5; ++n) |
|
11 |
{ |
|
12 |
usb_puts("# Testing rangefinder "); |
|
13 |
usb_puti(n); |
|
14 |
usb_puts(NL); |
|
15 |
|
|
16 |
|
|
11 |
usb_puts("# Testing rangefinder "); |
|
12 |
usb_puti(num); |
|
13 |
usb_puts(NL); |
|
14 |
|
|
17 | 15 |
// rotate to position |
18 | 16 |
// |
19 | 17 |
// for (wall positions up/down) |
... | ... | |
22 | 20 |
// send (read) |
23 | 21 |
// receive (data) |
24 | 22 |
// } |
25 |
} |
|
23 |
//send data |
|
24 |
} |
|
26 | 25 |
|
27 |
//send data |
|
26 |
|
|
27 |
void test_rangefinder_all (void) |
|
28 |
{ |
|
29 |
usb_puts("# Testing rangefinders" NL); |
|
28 | 30 |
|
31 |
for (int n=0; n<5; ++n) |
|
32 |
test_rangefinder (n); |
|
33 |
|
|
29 | 34 |
usb_puts("# Testing rangefinders finished" NL); |
30 | 35 |
} |
31 |
|
Also available in: Unified diff