root / trunk / code / projects / traffic_navigation / validTurns-test.c @ 1883
History | View | Annotate | Download (859 Bytes)
1 |
#include <dragonfly_lib.h> |
---|---|
2 |
#include "lineDrive.h" |
3 |
#include "validTurns.h" |
4 |
|
5 |
#ifdef TEST_VALIDTURNS
|
6 |
|
7 |
int main(){
|
8 |
/*barcode should be written as crosstype, crosspos. 5 bit integers*/
|
9 |
|
10 |
dragonfly_init(ALL_ON); |
11 |
orb1_set_color(YELLOW); |
12 |
|
13 |
int barcode1 = (DOUBLE_C<<2)+(TMIDDLE); |
14 |
if (validateTurn(barcode1, ILEFT)==ILEFT) orb1_set_color(GREEN);
|
15 |
|
16 |
delay_ms(100);
|
17 |
orb1_set_color(PINK); |
18 |
delay_ms(50);
|
19 |
|
20 |
int barcode2 = (DOUBLE_C<<2)+(TMIDDLE); |
21 |
if (validateTurn(barcode2, IUTURN)==IUTURN) orb1_set_color(GREEN);
|
22 |
|
23 |
delay_ms(100);
|
24 |
orb1_set_color(RED); |
25 |
delay_ms(50);
|
26 |
|
27 |
int barcode3 = (DOUBLE_T<<2)+(TMIDDLE); |
28 |
if (validateTurn(barcode3, IUTURN)==IUTURN) orb1_set_color(GREEN);
|
29 |
|
30 |
delay_ms(100);
|
31 |
orb1_set_color(PURPLE); |
32 |
delay_ms(50);
|
33 |
|
34 |
int barcode4 = (DOUBLE_T<<2)+(TMIDDLE); |
35 |
if (validateTurn(barcode4, ISTRAIGHT)==IUTURN) orb1_set_color(GREEN);
|
36 |
|
37 |
while (1){} |
38 |
|
39 |
} |
40 |
|
41 |
#endif TEST_VALIDTURNS
|