Hi, newbie here and Ive got an issue.
I’ve been trying to program my 2 motor Ball Punch and I’ve ran into some trouble. I need one motor to move forwards at 30rpm and one to move in reverse at 50rpm while the button R2 is pressing and stop when it’s not pressing. When I run the code it does nothing? I used the exact same method for my 2 motor forklift with no issues whatsoever.
When I upload the code to the brain it does not have any error messages.
Any help would be greatly appreciated!
Here’s the code (Forklift code included too)
while(true) {
if (Controller1.ButtonL2.pressing()){
FORKLIFT1.spin(directionType::fwd);
FORKLIFT2.spin(directionType::rev);
}
else if (Controller1.ButtonL1.pressing()){
FORKLIFT1.spin(directionType::rev);
FORKLIFT2.spin(directionType::fwd); }
else {
FORKLIFT1.stop();
FORKLIFT2.stop();
}
}
while(true) {
if (Controller1.ButtonR2.pressing()){
BALLPUNCH1.spin(directionType::fwd,30,velocityUnits::rpm);
BALLPUNCH2.spin(directionType::rev,50,velocityUnits::rpm); }
else {
BALLPUNCH1.stop();
BALLPUNCH2.stop();
}
}