I thought I posted this earlier, but can’t find it.
I have always used If Else statements for programming buttons. However, this year, I’m trying to have certain motors on different programs, so I want to try Pressed Release. Below is the code and error. Any help is useful. I’ve truncated some code to make it more readable.
Blockquote
void AllIn(int SpeedPCT){
Intake.spin(directionType::fwd, SpeedPCT, velocityUnits::pct);
Toproll.spin(directionType::fwd, SpeedPCT, velocityUnits::pct);
Outtake.spin(directionType::fwd, SpeedPCT, velocityUnits::pct);
Uproll.spin(directionType::fwd, SpeedPCT, velocityUnits::pct);
}
void AllStop()
{
Intake.stop(brakeType::hold);
Toproll.stop(brakeType::hold);
Outtake.stop(brakeType::hold);
Uproll.stop(brakeType::hold);
}
later in a while statement…
Controller1.ButtonR1.pressed(AllIn(100))
I am getting error code “cannot initialize a parameter of type ‘void (*()’ with an rvalue of type 'void”
Any help is appreciated.