Revision 1966
Added test map data encoding to intersectData.c. Fixe a whole bunch of stuff so
that at least this traffic_navigation compiles without warnings. Symlinked to
needed files in linefollow. Changed function declaration style. Added
delclaration of read_line to analog.h. You're welcome. Fixed several #includes.
You're all welcome.
validTurns-test.c | ||
---|---|---|
1 |
#include <dragonfly_lib.h> |
|
2 |
#include "intersectData.h" |
|
3 |
#include "validTurns.h" |
|
4 |
#include "lineDrive.h" |
|
5 |
|
|
6 |
//#define TEST_VALIDTURNS |
|
7 |
|
|
8 |
#ifdef TEST_VALIDTURNS |
|
9 |
|
|
10 |
int main(){ |
|
11 |
|
|
12 |
dragonfly_init(ALL_ON); |
|
13 |
orb1_set_color(YELLOW); |
|
14 |
|
|
15 |
initializeData(); |
|
16 |
|
|
17 |
if (getTurnIntType(INTERSECTION_DOUBLE_C) == DOUBLE) orb1_set_color(GREEN); |
|
18 |
|
|
19 |
delay_ms(500); |
|
20 |
orb1_set_color(PINK); |
|
21 |
delay_ms(500); |
|
22 |
|
|
23 |
if (getTurnIntType(INTERSECTION_DOUBLE_T) == DOUBLE) orb1_set_color(GREEN); |
|
24 |
|
|
25 |
delay_ms(500); |
|
26 |
orb1_set_color(BLUE); |
|
27 |
delay_ms(500); |
|
28 |
|
|
29 |
if (getTurnIntType(INTERSECTION_SINGLE) == SINGLE) orb1_set_color(GREEN); |
|
30 |
|
|
31 |
delay_ms(500); |
|
32 |
orb1_set_color(PINK); |
|
33 |
delay_ms(500); |
|
34 |
|
|
35 |
if (getTurnIntType(INTERSECTION_ON_RAMP) == ON_RAMP) orb1_set_color(GREEN); |
|
36 |
|
|
37 |
delay_ms(500); |
|
38 |
orb1_set_color(BLUE); |
|
39 |
delay_ms(500); |
|
40 |
|
|
41 |
if( getTurnIntType(getIntersectType(0)) == DOUBLE) orb1_set_color(GREEN); |
|
42 |
|
|
43 |
delay_ms(500); |
|
44 |
orb1_set_color(PINK); |
|
45 |
delay_ms(500); |
|
46 |
|
|
47 |
/*****************************TEST FOR validTurns.c |
|
48 |
int barcode = 0; |
|
49 |
|
|
50 |
if (validateTurn(barcode, ILEFT)==ILEFT) orb1_set_color(GREEN); |
|
51 |
|
|
52 |
delay_ms(100); |
|
53 |
orb1_set_color(PINK); |
|
54 |
delay_ms(50); |
|
55 |
|
|
56 |
if (validateTurn(barcode, IUTURN)==IUTURN) orb1_set_color(GREEN); |
|
57 |
|
|
58 |
delay_ms(100); |
|
59 |
orb1_set_color(RED); |
|
60 |
delay_ms(50); |
|
61 |
*/ |
|
62 |
while (1){} |
|
63 |
|
|
64 |
} |
|
65 |
|
|
66 |
#endif |
Also available in: Unified diff