Revision 1851
Added turning
lineFollow.h | ||
---|---|---|
8 | 8 |
#define BLACK 2 |
9 | 9 |
#define CENTER 3 |
10 | 10 |
#define NOLINE -42 |
11 |
#define SPEED 170 |
|
12 | 11 |
#define LINELOST -1 |
13 | 12 |
|
14 | 13 |
/* lineFollow_init |
... | ... | |
21 | 20 |
Must call lineFollow first |
22 | 21 |
Must be called inside a loop |
23 | 22 |
*/ |
24 |
int lineFollow(); |
|
23 |
int lineFollow(int speed);
|
|
25 | 24 |
|
26 |
/* assignColor |
|
27 |
Converts an analog color to WHITE or BLACK |
|
25 |
/* turnLeft and turnRight |
|
26 |
Must be called inside a loop |
|
27 |
returns 0 when complete |
|
28 | 28 |
*/ |
29 |
int assignColor(int port, int analog); |
|
29 |
int turnLeft(); |
|
30 |
int turnRight(); |
|
30 | 31 |
|
31 |
/* updateIR |
|
32 |
Gets the value of the nth line sensor |
|
33 |
*/ |
|
34 |
int updateIR(int n); |
|
35 |
|
|
36 | 32 |
/* updateLine |
33 |
Reads in the analog values |
|
37 | 34 |
Fills the given array with WHITE |
38 | 35 |
or BLACK representing the line |
39 | 36 |
*/ |
Also available in: Unified diff