root / trunk / code / projects / traffic_navigation / validTurns-test.c @ 1943
History | View | Annotate | Download (1.22 KB)
1 | 1880 | pdeo | #include <dragonfly_lib.h> |
---|---|---|---|
2 | 1886 | pdeo | #include "intersectData.h" |
3 | 1880 | pdeo | #include "validTurns.h" |
4 | 1907 | pdeo | #include "lineDrive.h" |
5 | 1880 | pdeo | |
6 | 1896 | bwasserm | //#define TEST_VALIDTURNS
|
7 | 1886 | pdeo | |
8 | 1883 | jdcooper | #ifdef TEST_VALIDTURNS
|
9 | |||
10 | 1880 | pdeo | int main(){
|
11 | |||
12 | 1886 | pdeo | dragonfly_init(ALL_ON); |
13 | orb1_set_color(YELLOW); |
||
14 | 1884 | jdcooper | |
15 | 1886 | pdeo | initializeData(); |
16 | |||
17 | 1907 | pdeo | 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 | 1886 | pdeo | int barcode = 0;
|
49 | |||
50 | if (validateTurn(barcode, ILEFT)==ILEFT) orb1_set_color(GREEN);
|
||
51 | 1880 | pdeo | |
52 | 1886 | pdeo | delay_ms(100);
|
53 | orb1_set_color(PINK);
|
||
54 | delay_ms(50);
|
||
55 | 1880 | pdeo | |
56 | 1886 | pdeo | if (validateTurn(barcode, IUTURN)==IUTURN) orb1_set_color(GREEN);
|
57 | |||
58 | delay_ms(100);
|
||
59 | orb1_set_color(RED);
|
||
60 | delay_ms(50);
|
||
61 | 1907 | pdeo | */
|
62 | 1886 | pdeo | while (1){} |
63 | 1880 | pdeo | |
64 | } |
||
65 | |||
66 | 1886 | pdeo | #endif |