PController
This class controls a motor using a proportional coefficient that is applied to the error in order to calculate the power that the motor should be set to during any given time.
Parameters
k P
the proportional coefficient
Functions
Link copied to clipboard
Initializes the motor controller.
Link copied to clipboard
Checks if the motor is within a certain threshold of the target. Used when calculating if the motor should be running still. Checks the absolute value of the error (because it doesn't need to be calculating the direction the motor needs to move) against a threshold.