Function pressed driver control

Does anyone know how to program the function “pressed” in drivercontrol (vex v5 code pro).
For example: if id like a motor to rotate a certain number of rotationunits or degrees, how would that be done? (Not print on brain screen)

Welcome to the VEXForum @falasteeni!

The search bar could probably yield quite a few answers, here is one of the better threads


Thank you so much @trontech569 ! Unfortunately we’ve already consulted this thread, yet we still can’t figure out how to make it work.

Our team is also having trouble with this. Whenever we try to use the line of code “Controller.Button.pressed()”, there’s an error one way or another. I checked, I’m not missing any brackets or anything. We’re at a loss.

1 Like

Hmmm. Well, the motor.rotateFor(); command might do the trick.
Making sure to use the wait for completion parameter.

I mean, you could probably do something like:


motor.rotateFor(whatever, wait for completion);

Using the pressed command you could probably do:

void pressedfunction (){
motor.rotateFor(whatever, wait for completion);

int main() {
    Controller.ButtonA.pressed(pressedfunction);//every time Button A is pressed function() is run
    while(true){//so program doesn't exit

Not sure about that second code though, I haven’t tried much with the pressed command.

If you have specific code that is not working you could also post it.


god bless your soul
you made it clearer

1 Like