Revision 1940 trunk/code/projects/linefollowing/main.c

View differences:

main.c
21 21
	int barCode;
22 22
	while(1)
23 23
	{
24
		/*usb_puti(read_line(0));
25
        delay_ms(10);
26
        	usb_putc('\t');
27
		usb_puti(read_line(0));
28
        delay_ms(10);
29
        	usb_putc('\t');
30
		usb_puti(read_line(6));
31
        delay_ms(10);
32
        	usb_putc('\t');
33
		usb_puti(read_line(6));
34
        delay_ms(10);
35
        	usb_putc('\t');
36
		usb_puti(read_line(7));
37
        delay_ms(10);
38
        	usb_putc('\t');
39
		usb_puti(read_line(7));
40
        delay_ms(10);
41
        	usb_putc('\t');
42
		usb_puti(read_line(5));
43
        delay_ms(10);
44
        	usb_putc('\t');
45
		usb_puti(read_line(5));
46
        delay_ms(10);
47
        	usb_putc('\t');
48
		usb_putc(13);
49
        delay_ms(10);*/
50
/*
51
		usb_puti(read_line(0));
52
        	usb_putc('\t');
53
		usb_puti(read_line(4));
54
        	usb_putc('\t');
55
		usb_puti(read_line(2));
56
        	usb_putc('\t');
57
		usb_puti(read_line(6));
58
        	usb_putc('\t');
59
		usb_puti(read_line(1));
60
        	usb_putc('\t');
61
		usb_puti(read_line(5));
62
        	usb_putc('\t');
63
		usb_puti(read_line(3));
64
        	usb_putc('\t');
65
		usb_puti(read_line(7));
66
        	usb_putc('\t');
67
		usb_putc(13);
68
*/
69
		usb_puti(read_line(0));
70
        	usb_putc('\t');
71
		usb_puti(read_line(1));
72
        	usb_putc('\t');
73
		usb_puti(read_line(2));
74
        	usb_putc('\t');
75
		usb_puti(read_line(3));
76
        	usb_putc('\t');
77
		usb_puti(read_line(4));
78
        	usb_putc('\t');
79
		usb_puti(read_line(5));
80
        	usb_putc('\t');
81
		usb_puti(read_line(6));
82
        	usb_putc('\t');
83
		usb_puti(read_line(7));
84
        	usb_putc('\t');
85
		usb_putc(13);
86

  
87
	/*	
88

  
89
		for(int q=0; q<500; q++)
90
			barCode = lineFollow(200);
91
		while(mergeLeft());
92
		for(int q=0; q<1000; q++)lineFollow(200);
93 24
		
94
		continue;
95
		if(barCode==-25)while(turnRight());
96
		continue;
97
		if(barCode != -2 && barCode != LINELOST)
98
		{
99
			usb_puti(barCode);
100
			usb_putc('\n');
101
		}
102
*/
25
		lineFollow(200);
103 26

  
104 27

  
105 28

  
106
/*		
107

  
108
		switch (barCode)
109
		{	
110

  
111
		
112
			case 0: orb_set_color(RED); break;
113
			case 1: orb_set_color(ORANGE); break;
114
			case 2: orb_set_color(YELLOW); break;
115
			case 3: orb_set_color(LIME); break;
116
			case 4: orb_set_color(GREEN); break;
117
			case 5: orb_set_color(CYAN); break;
118
			case 6: orb_set_color(BLUE); break;
119
			case 7: orb_set_color(PINK); break;
120
			case 8: orb_set_color(PURPLE); break;
121
			case 9: orb_set_color(MAGENTA); break;
122
			default: orb_set_color(WHITE); break;
123 29
	
124
			case 0:
125
				straight();
126
				turnRight();
127
				break;
128
                        case 2:
129
	                        straight();
130
        	                break;
131
                        case 3:
132
	                        straight();
133
				turnLeft();
134
        	                break;
135
		
136
		}
137
*/	
138 30
	}
139 31
	return 0;
140 32
}

Also available in: Unified diff