Hello, recently I have been working on autonomous but when I code two motors ( two drive motors ) the go one at a time instead of both at a single time. So temporaily I used time something like this
void autonomous(void) {
drivemotora.spin(directionType::fwd, 50, velocityUnits::pct);
drivemotorb.spin(directionType::fwd, 50, velocityUnits::pct);
task::sleep(1500);
drivemotora.stop();
drivemotorb.stop();
}
So this would be driving forward for 1.5 seconds
But I want to try to be using rotations as it is usually more accurate.
Whenever I try using rotation it would fire consecutively.
void autonomous(void) {
drivemotora.rotateFor( 4, rotationUnits::rev);
drivemotorb.rotateFor( 4, rotationUnits::rev);
}
This is just an example of what I had.
If anyone understands the problem then please help me.
Thanks, Eclipse 7157A