Callback error in coding

Hello! I am currently having a problem with my code that I do not know how to fix. Could someone help? Here it is:

if(Controller1.ButtonR1.pressed()) {
(rightIntake.spin(directionType::fwd, 100, velocityUnits::pct));

The code is highlighting the bolded parentheses and is saying this:

“Too few arguments to function call, single argument ‘callback’ was not specified”

If anyone can help, it would be much apreciated. Thanks!

pretty sure you want this

if(Controller1.ButtonR1.pressing ) {
(rightIntake.spin(directionType::fwd, 100, velocityUnits::pct));

I’m not sure if that is the right idea. I am trying to make it so that when the button is pressed, the intakes move and dont stop until another button is pressed.

the motor won’t stop until you use the command motor.stop() so this would still make it continue to move

1 Like

really? thanks!

but is there a button.pressed command? and if so, what does it do?

to clarify, I do not want to hold the button

yeah basically what i’m saying is that it is always checking for this button to be pushed, once it is it activates motor.spin which will keep the motor spinning until motor.stop is called, so it would take 1 button push to get it going, the only way how this wouldn’t work would be if these commands weren’t within a while loop.

1 Like

Okay. Thanks a lot! 20 char