Hopefully this is an easy one… for some reason when drive2Target is evoked by the controller the robot only jerks - does nothing. Apparently it’s not completing b/c it seems 2b locking up the task.
} else if (Controller1.ButtonR1.pressing()) { drive2Target(dist2Cube);
The function works when called from auton:
void drive2Target(double target) { // drive by spin
wait(200,msec);
double deg2target = (dist_mm - target - 40) / 0.866666;
rDrive(deg2target, deg2target, Dist.distance(vex::distanceUnits::mm)/target * 8 ,Dist.distance(vex::distanceUnits::mm)/target * 8 , 1);
} // end drive2Target