So, I want to make it so that when the controller button up is pressed, it runs our flywheel motor until down is pressed. However, it keeps giving me the “too few arguments to function call, single argument ‘callback’ was not specified” error. I have checked many posts asking about this, and I do not understand any of the answers, so please do not link other forum posts/questions, and directly respond in a way that I (C++ V5 only, first year) could understand.
I know I should use pressing. That’s the default for the controller, too. I took it off of the controller SPECIFICALLY so that I could use “pressed”. I want to make it so that the driver doesn’t have to hold down the button every time they shoot.
Also, the resource you linked is for Vexcode Pro, which I do not have access to.
pressing() returns the current state of the button, is the user “pressing” the button or not.
pressed() is used to register an event handler, that is, a function that will be executed every time the user presses the button. When the button is “pressed” call this function.
It all depends on which style of programming you want to use as to which you choose.
There is no API to configure the button as a toggle button that changes state each time you press it, that’s code you need to write yourself.