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

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

Go to the source code of this file.

Data Structures

struct  DRIVE

Defines

#define _DRIVE_H
#define MOD_ID   MOD_DRIVE
#define DRIVEF_ON   0x0100
#define DRIVEF_STALL_PROTECT_ON   0x0200
#define DRIVEF_STALLED   0x0400
#define MOTOR_MIN_VALUE   -100
#define MOTOR_MAX_VALUE   100
#define MIN_STALL_POWER   20
#define STALL_TIME   2000
#define NORMALIZE_DRIVE(x, m, n)   NORMALIZE(x, m, n, MOTOR_MIN_VALUE, MOTOR_MAX_VALUE)

Functions

void DriveStop (__out DRIVE &drive)
void DriveReset (__out DRIVE &drive)
void DriveInit (__out DRIVE &drive, __in int leftMotor, __in int rightMotor, __in float distPerClick, __in float degreesPerClick)
void DriveStallProtect (__inout DRIVE &drive, __in bool fOn)
void DriveTank (__out DRIVE &drive, __in int leftPower, __in int rightPower)
void DriveArcade (__out DRIVE &drive, __in int drivePower, __in int turnPower)
void DriveTask (__inout DRIVE &drive)

Define Documentation

#define _DRIVE_H

Definition at line 16 of file drive.h.

#define DRIVEF_ON   0x0100

Definition at line 28 of file drive.h.

#define DRIVEF_STALL_PROTECT_ON   0x0200

Definition at line 29 of file drive.h.

#define DRIVEF_STALLED   0x0400

Definition at line 30 of file drive.h.

#define MIN_STALL_POWER   20

Definition at line 35 of file drive.h.

#define MOD_ID   MOD_DRIVE

Definition at line 23 of file drive.h.

#define MOTOR_MAX_VALUE   100

Definition at line 33 of file drive.h.

#define MOTOR_MIN_VALUE   -100

Definition at line 32 of file drive.h.

#define NORMALIZE_DRIVE (   x,
  m,
 
)    NORMALIZE(x, m, n, MOTOR_MIN_VALUE, MOTOR_MAX_VALUE)

Definition at line 41 of file drive.h.

#define STALL_TIME   2000

Definition at line 36 of file drive.h.


Function Documentation

void DriveArcade ( __out DRIVE drive,
__in int  drivePower,
__in int  turnPower 
)

This function sets power of the motors for arcade drive.

Parameters:
drivePoints to the DRIVE structure.
drivePowerSpecifies the drive power.
turnPowerSpecifies the turn power.

Definition at line 207 of file drive.h.

void DriveInit ( __out DRIVE drive,
__in int  leftMotor,
__in int  rightMotor,
__in float  distPerClick,
__in float  degreesPerClick 
)

This function initializes the drive system.

Parameters:
drivePoints to the DRIVE structure to be initialized.
leftMotorSpecifies the left motor.
rightMotorSpecifies the right motor.

Definition at line 121 of file drive.h.

void DriveReset ( __out DRIVE drive)

This function resets the drive system.

Parameters:
drivePoints to the DRIVE structure to be reset.

Definition at line 96 of file drive.h.

void DriveStallProtect ( __inout DRIVE drive,
__in bool  fOn 
)

This function enables or disables stall protection.

Parameters:
drivePoints to the DRIVE structure to be initialized.
fOnIf true, enables stall protection.

Definition at line 151 of file drive.h.

void DriveStop ( __out DRIVE drive)

This function stops the motors in the drive system.

Parameters:
drivePoints to the DRIVE structure.

Definition at line 66 of file drive.h.

void DriveTank ( __out DRIVE drive,
__in int  leftPower,
__in int  rightPower 
)

This function sets power of the motors for tank drive.

Parameters:
drivePoints to the DRIVE structure.
leftPowerSpecifies the left motor power.
rightPowerSpecifies the right motor power.

Definition at line 181 of file drive.h.

void DriveTask ( __inout DRIVE drive)

This function performs the driving task according to the drive state.

Parameters:
drivePoints to the DRIVE structure.

Definition at line 276 of file drive.h.

 All Data Structures Files Functions Variables Defines