Revision 1854
lineFollow now supports merge. line drive is UNTESTED and has NO COMMENTS, but will provide higher level driving control
lineFollow.h | ||
---|---|---|
3 | 3 |
#ifndef _LINEFOLLOW_H_ |
4 | 4 |
#define _LINEFOLLOW_H_ |
5 | 5 |
|
6 |
#define WHITE 0 |
|
7 |
#define GREY 1 |
|
8 |
#define BLACK 2 |
|
6 |
#define LWHITE 0
|
|
7 |
#define LGREY 1
|
|
8 |
#define LBLACK 2
|
|
9 | 9 |
#define CENTER 3 |
10 | 10 |
#define NOLINE -42 |
11 | 11 |
#define LINELOST -1 |
12 | 12 |
|
13 |
#define NOBARCODE -2 |
|
14 |
#define INTERSECTION -25 |
|
15 |
#define FULL_LINE -26 |
|
16 |
|
|
17 |
|
|
18 |
|
|
13 | 19 |
/* lineFollow_init |
14 | 20 |
Must call before lineFollow |
15 | 21 |
Turns analog loop off |
16 | 22 |
*/ |
17 |
void lineFollow_init(); |
|
23 |
void lineFollow_init(void);
|
|
18 | 24 |
|
19 | 25 |
/* lineFollow |
20 | 26 |
Must call lineFollow first |
... | ... | |
22 | 28 |
*/ |
23 | 29 |
int lineFollow(int speed); |
24 | 30 |
|
25 |
/* turnLeft and turnRight
|
|
31 |
/* turnLeft turnRight mergeLeft mergeRight
|
|
26 | 32 |
Must be called inside a loop |
27 | 33 |
returns 0 when complete |
28 | 34 |
*/ |
29 |
int turnLeft(); |
|
30 |
int turnRight(); |
|
35 |
int turnLeft(void); |
|
36 |
int turnRight(void); |
|
37 |
int mergeLeft(void); |
|
38 |
int mergeRight(void); |
|
31 | 39 |
|
32 | 40 |
/* updateLine |
33 | 41 |
Reads in the analog values |
... | ... | |
43 | 51 |
*/ |
44 | 52 |
int lineLocate(int* colors); |
45 | 53 |
|
46 |
//Not implemented yet, returns ??? |
|
47 |
void updateBarCode(); |
|
54 |
/* updatebarCode |
|
55 |
Reads in and processes |
|
56 |
bar code data |
|
57 |
*/ |
|
58 |
void updateBarCode(void); |
|
48 | 59 |
|
49 |
/* min |
|
50 |
returns the minimum of two values |
|
60 |
/* getBarCode |
|
61 |
returns a bar code, if |
|
62 |
available, otherwise NOBARCODE |
|
51 | 63 |
*/ |
64 |
int getBarCode(void); |
|
65 |
|
|
66 |
/* min max |
|
67 |
returns the minimum/maximum of two values |
|
68 |
*/ |
|
52 | 69 |
int min(int x, int y); |
70 |
int max(int x, int y); |
|
53 | 71 |
|
54 | 72 |
/* motorLeft |
55 | 73 |
Commands the left motor |
Also available in: Unified diff