I’m trying to make it so that when tilting up the cube tray, it goes fast at first (ex: 50 deg/sec), then slows down when approaching vertical to allow for finer adjustments to the stack.
Currently i have this set up in main():
//set the cubetilt motor's 0 position to the starting position
cubeTilt.resetRotation();
//Set up callbacks for autonomous and driver control periods.
Competition.autonomous( autonomous );
Competition.drivercontrol( usercontrol );
and then in driver control:
if(cubeTilt.rotation(vex::rotationUnits::deg) < 90) {
cubeTilt.spin(vex::directionType::fwd, 50, vex::velocityUnits::dps);
}
else {
cubeTilt.spin(vex::directionType::fwd, 10, vex::velocityUnits::dps);
}
this currently does nothing. the speed never changes. Any ideas on how to fix this?