Skip to content

Instantly share code, notes, and snippets.

@NoahBres
Created November 4, 2020 07:45
Show Gist options
  • Save NoahBres/b6a7d08b4f390c2902b0ac27261db36f to your computer and use it in GitHub Desktop.
Save NoahBres/b6a7d08b4f390c2902b0ac27261db36f to your computer and use it in GitHub Desktop.
MotorConfigurationType motorConfigurationType = myMotor.getMotorType().clone();
motorConfigurationType.setAchieveableMaxRPMFraction(1.0);
myMotor.setMotorType(motorConfigurationType);
myMotor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
// Call motor.setPower() like normal
// Velo PID is automagically set up for you
// and runs in the background
// Set velocity to 75% of max RPM
myMotor.setPower(0.75)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment