Drive.h#
Description#
Constants#
The following constants are
#defined inDrive.h:Constant
Value
NUM_MOTORS2
ACCELERATION_RATE0.00375f
RB_ACCELERATION_RATE0.0015f
BRAKE_PERCENTAGE0.9
TIME_INCREMENT5
NORMAL_TURN_CONSTANT0.05
TANK_MODE_PCT0.75
RB_TANK_MODE_PCT0.5
DRIFT_MODE_PCT0.8
STICK_DEADZONE0.075
THRESHOLD0.00001
FALCON_CALIBRATION_FACTOR1.0f
MOTOR_ZERO_OFFSET0.05f
SMALL_12V_BOOST_PCT0.15f
SMALL_12V_NORMAL_PCT0.1f
SMALL_12V_SLOW_PCT0.05f
BRAKE_BUTTON_PCT0
The speed scalar values (boost, normal, and slow) are also defined for each motor type.
Drive Class#
Notable class fields include:
the robot type (
BotType)the motor type (
MotorType)turn adjustment variables
stickForwardRevandstickTurnrequestedMotorPower,turnMotorValues, andlastRampPower(all arrays with a size equal toNUM_MOTORS)
The
Speed(BNS) enum is defined with valuesBOOST,NORMAL,SLOW,BRAKE.Functions defined in Drive.cpp are prototyped.
Included Headers#
Arduino.h