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