Statistics
| Revision:

## root / trunk / code / projects / traffic_navigation / lineFollow.h @ 1858

 1 ```#include ``` ``` #ifndef _LINEFOLLOW_H_ ``` ``` #define _LINEFOLLOW_H_ ``` ```#define LWHITE 0 ``` ```#define LGREY 1 ``` ```#define LBLACK 2 ``` ```#define CENTER 3 ``` ```#define NOLINE -42 ``` ```#define LINELOST -1 ``` ```#define NOBARCODE -2 ``` ```#define INTERSECTION -25 ``` ```#define FULL_LINE -26 ``` ```/* lineFollow_init ``` ``` Must call before lineFollow ``` ``` Turns analog loop off ``` ```*/ ``` ```void lineFollow_init(void); ``` ```/* lineFollow ``` ``` Must call lineFollow first ``` ``` Must be called inside a loop ``` ```*/ ``` ```int lineFollow(int speed); ``` ```/* turnLeft turnRight mergeLeft mergeRight ``` ``` Must be called inside a loop ``` ``` returns 0 when complete ``` ```*/ ``` ```int turnLeft(void); ``` ```int turnRight(void); ``` ```int mergeLeft(void); ``` ```int mergeRight(void); ``` ```/* updateLine ``` ``` Reads in the analog values ``` ``` Fills the given array with WHITE ``` ``` or BLACK representing the line ``` ```*/ ``` ```void updateLine(int* values); ``` ```/* lineLocate ``` ``` Finds the location of the line ``` ``` Outputs positive for right side ``` ``` Negative for left, or NOLINE if a line is not found ``` ```*/ ``` ```int lineLocate(int* colors); ``` ```/* updatebarCode ``` ``` Reads in and processes ``` ``` bar code data ``` ```*/ ``` ```void updateBarCode(void); ``` ```/* getBarCode ``` ``` returns a bar code, if ``` ``` available, otherwise NOBARCODE ``` ```*/ ``` ```int getBarCode(void); ``` ```/* min max ``` ``` returns the minimum/maximum of two values ``` ```*/ ``` ```int min(int x, int y); ``` ```int max(int x, int y); ``` ```/* motorLeft ``` ``` Commands the left motor ``` ``` Cannot be used to stop ``` ``` 0-126 are backward ``` ``` 127-255 are forward ``` ```*/ ``` ```void motorLeft(int speed); ``` ```/* motorRight ``` ``` Commands the right motor ``` ``` Cannot be used to stop ``` ``` 0-126 are backward ``` ``` 127-255 are forward ``` ```*/ ``` ```void motorRight(int speed); ``` ```/* lost ``` ``` Internal counter to detect if the line was lost ``` ```*/ ``` ```int lost; ``` ```#endif ```