So here we go again. I want to figure out this time how to make my autonomous (which is by turns not time) be able to go ex. 2.5 turns and not have to be a whole number ex. 2.
my void:
void goForward(int x){
LF.startRotateFor(x,turns);
RF.startRotateFor(x,turns);
RB.startRotateFor(x,turns);
LB.rotateFor(x,turns);
LF.stop();
RF.stop();
LB.stop();
}
my autonomous rn:
Competition.autonomous(autonomous);
forwardPick(2);
I WANT TO KNOW HOW TO PUT 2.5 TURNS I ALREADY KNOW HOW TO MAKE IT JUST ITS THAT I CANT PUT HALF INTERVALS.
Change “int x” to “float x”. The integer variable type you’re using can only be set to whole numbers.
4 Likes