Project

General

Profile

Statistics
| Revision:

root / trunk / code / projects / traffic_navigation / validTurns-test.c @ 1884

History | View | Annotate | Download (934 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
/*barcode should be three bits of intersection type and 2 of entrypoint*/
11

    
12
dragonfly_init(ALL_ON);
13
orb1_set_color(YELLOW);
14

    
15
int barcode1 = (DOUBLE_C<<2)+(TMIDDLE);
16
if (validateTurn(barcode1, ILEFT)==ILEFT) orb1_set_color(GREEN);
17

    
18
delay_ms(100);
19
orb1_set_color(PINK);
20
delay_ms(50);
21

    
22
int barcode2 = (DOUBLE_C<<2)+(TMIDDLE);
23
if (validateTurn(barcode2, IUTURN)==IUTURN) orb1_set_color(GREEN);
24

    
25
delay_ms(100);
26
orb1_set_color(RED);
27
delay_ms(50);
28

    
29
int barcode3 = (DOUBLE_T<<2)+(TMIDDLE);
30
if (validateTurn(barcode3, IUTURN)==IUTURN) orb1_set_color(GREEN);
31

    
32
delay_ms(100);
33
orb1_set_color(PURPLE);
34
delay_ms(50);
35

    
36
int barcode4 = (DOUBLE_T<<2)+(TMIDDLE);
37
if (validateTurn(barcode4, ISTRAIGHT)==IUTURN) orb1_set_color(GREEN);
38

    
39
while (1){}
40

    
41
}
42

    
43
#endif TEST_VALIDTURNS