Project

General

Profile

Revision 1881

Merged the types of doubles into the crossing type. Also fixed comments
that were never updated and implements things of type DOUBLE as DOUBLE_T's
if you dont specify because DOUBLE_T is more safe.

View differences:

validTurns-test.c
3 3
#include "validTurns.h"
4 4

  
5 5
int main(){
6
/*barcode should be written as double type (DOUBLE_C or DOUBLE_T), crosstype, crosspos, turntype. 6-9 bit integers*/
6
/*barcode should be written as crosstype, crosspos. 5 bit integers*/
7 7

  
8 8
dragonfly_init(ALL_ON);
9 9
orb1_set_color(YELLOW);
10 10

  
11
int barcode1 = (DOUBLE_C<<4)+(DOUBLE<<2)+(TMIDDLE);
11
int barcode1 = (DOUBLE_C<<2)+(TMIDDLE);
12 12
if (validateTurn(barcode1, ILEFT)==ILEFT) orb1_set_color(GREEN);
13 13

  
14 14
delay_ms(100);
15 15
orb1_set_color(PINK);
16 16
delay_ms(50);
17 17

  
18
int barcode2 = (DOUBLE_C<<4)+(DOUBLE<<2)+(TMIDDLE);
18
int barcode2 = (DOUBLE_C<<2)+(TMIDDLE);
19 19
if (validateTurn(barcode2, IUTURN)==IUTURN) orb1_set_color(GREEN);
20 20

  
21 21
delay_ms(100);
22 22
orb1_set_color(RED);
23 23
delay_ms(50);
24 24

  
25
int barcode3 = (DOUBLE_T<<4)+(DOUBLE<<2)+(TMIDDLE);
25
int barcode3 = (DOUBLE_T<<2)+(TMIDDLE);
26 26
if (validateTurn(barcode3, IUTURN)==IUTURN) orb1_set_color(GREEN);
27

  
27
s
28 28
delay_ms(100);
29 29
orb1_set_color(PURPLE);
30 30
delay_ms(50);
31 31

  
32
int barcode4 = (DOUBLE_T<<4)+(DOUBLE<<2)+(TMIDDLE);
32
int barcode4 = (DOUBLE_T<<2)+(TMIDDLE);
33 33
if (validateTurn(barcode4, ISTRAIGHT)==IUTURN) orb1_set_color(GREEN);
34 34

  
35 35
while (1){}

Also available in: Unified diff