Project

General

Profile

Statistics
| Revision:

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

History | View | Annotate | Download (859 Bytes)

1 1880 pdeo
#include <dragonfly_lib.h>
2
#include "lineDrive.h"
3
#include "validTurns.h"
4
5 1883 jdcooper
#ifdef TEST_VALIDTURNS
6
7 1880 pdeo
int main(){
8 1881 pdeo
/*barcode should be written as crosstype, crosspos. 5 bit integers*/
9 1880 pdeo
10
dragonfly_init(ALL_ON);
11
orb1_set_color(YELLOW);
12
13 1881 pdeo
int barcode1 = (DOUBLE_C<<2)+(TMIDDLE);
14 1880 pdeo
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 1881 pdeo
int barcode2 = (DOUBLE_C<<2)+(TMIDDLE);
21 1880 pdeo
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 1881 pdeo
int barcode3 = (DOUBLE_T<<2)+(TMIDDLE);
28 1880 pdeo
if (validateTurn(barcode3, IUTURN)==IUTURN) orb1_set_color(GREEN);
29 1882 pdeo
30 1880 pdeo
delay_ms(100);
31
orb1_set_color(PURPLE);
32
delay_ms(50);
33
34 1881 pdeo
int barcode4 = (DOUBLE_T<<2)+(TMIDDLE);
35 1880 pdeo
if (validateTurn(barcode4, ISTRAIGHT)==IUTURN) orb1_set_color(GREEN);
36
37
while (1){}
38
39
}
40
41 1883 jdcooper
#endif TEST_VALIDTURNS