Motor
The UvuvLib Motor Class
UvuvMotor::UvuvMotor(uint8_t port, bool isReversedArg, Gearing gearRatioArg, pros::motor_gearset_e gearset,
UvuvMotor* pairMotorArg, PIDController* pidArg)
port - V5 Smart Port number
isReversedArg - Defines direction of the motor spinning. True is reversed, false is foward
gearRatioArg - Gear ratio of the motors mechanism. Accessed by "G_"
gearset - The PROS motor gearset
pairMotorArg - The motor paired with this motor. For example, leftFront and rightFront motors.
pid - The Built-in PID Controller for the motor
spinAtVoltage
Spins the motor at the provided voltage, given that the motor is not disabled
void spinAtVoltage(int voltage)
voltage - An integer between -12000 and 12000. This number determines the voltage that the motor will spin at
spinJoystick
Spins the motor in increments of 1/127 of its total power
void spinJoystick(int joystickValue)
joystickValue - An integer between -127 and 127 that determines the power that the motor spins at. This value would be the same one returned by a Joystick, hence the name of the function
spinPerc
Spins the motor as a percentage of its total power
void spinPerc(int percent)
percent - the percentage of the Total Power of the motor. Takes in an integer value between -100 to 100
spinPercVEXPID
Uses VEX Built in PID. Spins the motor at the indicated percentage of motor power. (DO NOT USE WITH PID)[Quasi-Deprecated]
void spinPercVEXPID(int percent)
percent - the fraction of the Total Power of the motor. Takes in an integer value between -127 to 127
spinAtRPM
Spins the motor at the given RPM
void spinAtRPM(int RPM)
RPM - The Rotations Per Minute you desire the motor to move. Works through the PID Controller, so make sure that you assign one to this motor before using it.
spinUntilDegree
Spins the motor around for how many degrees you provide it
void UvuvMotor::spinUntilDegree(int degree, int speedInVoltage)
degree - the amount of degrees you want the motor to spin
speedInVoltage - An integer between -12000 and 12000. This number determines the voltage that the motor will spin at
spinFor
Spins the motor for how many seconds you tell it to
void spinFor(float seconds, int speedInVoltage)
seconds - the amount of timke in seconds that the motor will spin for
speedInVoltage - An integer between -12000 and 12000. This number determines the voltage that the motor will spin at
logMotorPreference
Not yet Implemented
set_zero_position
Sets the motor position
void set_zero_position(int position)
position - Sets the absolute position of this motor to position
shutDown
Shuts down the motor
void shutDown()
Revive
Enables the Motor
void revive()
isOverheated
Checks if the motor is overheated, returns True if it is, false if it isn't
bool isOverheated()
getIsBroken
Returns back the isBroken param
bool getIsBroken()
getRPM
Returns the Rotations Per Minute that the Bot is doing at the moment
float getRPM()
getVoltage
Returns the voltage in the Motors at the moment
float getVoltage()
getEncoderPos
Gets the Motor Position in degrees.
float getEncoderPos()
Last updated