I am having trouble calling all motors (spinning motors all at once) in my 6-motor drivetrain at the same time during the autonomous period in C++. My code so far is:
void autodrive(){
L1.spinFor(reverse,600,degrees)
L2.spinFor(reverse,600,degrees)
L3.spinFor(reverse,600,degrees)
R1.spinFor(reverse,600,degrees)
R2.spinFor(reverse,600,degrees)
R3.spinFor(reverse,600,degrees)
}
I then call it but it moves every motor individually.
Someone else had a similar issue before read this post
When autonomous is used, the variables seem to not move/ not follow one another. They do one action and all the other variables are skipped.
here is an example of a drive forward command and a turn right command
anytime they are called, they do not do anything.
we have a four motor drive train and want all the motors to work at the same time.
float degreesFWD = inchesFWD*35.277;
leftMotor1.spinFor(forward, degreesFWD, degrees, false);
rightMotor1.spinFor(forward, degreesFWD, degrees, false);…
It has to do with passing a parameter called waitForCompletion and setting it to false.
Thank you so much! This was really helpful!
system
Closed
October 18, 2024, 8:15pm
4
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.