TRC Library for FTC (2011) 2011
TRC Library Code Project

C:/Users/Michael/Ftc/2011/code/trclib/lnfollow.h File Reference

Go to the source code of this file.

Data Structures

struct  LNFOLLOW

Defines

#define _LNFOLLOW_H
#define MOD_ID   MOD_LNFOLLOW
#define MAX_LIGHT_SENSORS   3
#define LNF_STARTED   0x0100
#define LNF_CALIBRATING   0x0200
#define LnFollowStarted(l)   (l.lnfollowFlags & LNF_STARTED)
#define LnFollowCalibrating(l)   (l.lnfollowFlags & LNF_CALIBRATING)

Functions

void LnFollowInit (__out LNFOLLOW &lnfollow, __in int drive, __in int pidCtrl, __in int numLightSensors, __in int driveKp)
void LnFollowCal (__inout LNFOLLOW &lnfollow, __in bool fStart)
void LnFollowStart (__inout LNFOLLOW &lnfollow, __in bool fStart)
void LnFollowTask (__inout LNFOLLOW &lnfollow)

Define Documentation

#define _LNFOLLOW_H

Definition at line 16 of file lnfollow.h.

#define LNF_CALIBRATING   0x0200

Definition at line 33 of file lnfollow.h.

#define LNF_STARTED   0x0100

Definition at line 32 of file lnfollow.h.

#define LnFollowCalibrating (   l)    (l.lnfollowFlags & LNF_CALIBRATING)

Definition at line 35 of file lnfollow.h.

#define LnFollowStarted (   l)    (l.lnfollowFlags & LNF_STARTED)

Definition at line 34 of file lnfollow.h.

#define MAX_LIGHT_SENSORS   3

Definition at line 29 of file lnfollow.h.

#define MOD_ID   MOD_LNFOLLOW

Definition at line 23 of file lnfollow.h.


Function Documentation

void LnFollowCal ( __inout LNFOLLOW lnfollow,
__in bool  fStart 
)

This function calibrates the light sensors of the line follower.

Parameters:
lnfollowPoints to the LNFOLLOW structure.
fStartSpecifies TRUE to start calibration, FALSE to stop.

Definition at line 131 of file lnfollow.h.

void LnFollowInit ( __out LNFOLLOW lnfollow,
__in int  drive,
__in int  pidCtrl,
__in int  numLightSensors,
__in int  driveKp 
)

This function initializes the line follower object.

Parameters:
lnfollowPoints to the LNFOLLOW structure to be initialized.
drivePoints to the DRIVE structure.
pidCtrlPoints to the PIDCTRL structure.
numLightSensorsSpecifies the number of light sensors used.
driveKpSpecifies the drive power scale factor.

Definition at line 66 of file lnfollow.h.

void LnFollowStart ( __inout LNFOLLOW lnfollow,
__in bool  fStart 
)

This function starts or stops the line follower.

Parameters:
lnfollowPoints to the LNFOLLOW structure.
fStartSpecifies TRUE to start the line follower, FALSE to stop.

Definition at line 165 of file lnfollow.h.

void LnFollowTask ( __inout LNFOLLOW lnfollow)

This function processes the sensor data for line following.

Parameters:
lnfollowPoints to the LNFOLLOW structure.

Definition at line 200 of file lnfollow.h.

 All Data Structures Files Functions Variables Defines