VEXcode IQ - combining autonomous code to a controller code

My student wants to make a function that when the R Up button is pressed it plays a set of blocks (i.e. move forward, then move claw up, etc.).

We made a MyBlock to sum up the set of movements mentioned and then called it within our forever loop, but nothing happened after we downloaded it. We checked the Controller under Devices and couldn’t assign the R Up button to anything.

Did we do something wrong or is just not possible ?

Is it just button R?

3 Likes

Just use an event block instead. When button X is pressed, the blocks below it will run.

5 Likes

Use an if statement. If controller R up pressed, then execute the block you made.

1 Like

I can’t believe I forgot about event blocks! Yes we will try that next time I meet with him.

Not necessarily, I said Button R because that’s the one he wants to tie the function to on the controller.

Oh, should I switch where I currently am using the if block? It’s currently already being used with the MyBlock already at the bottom left of the image.

Should it instead be? :
Forever loop
if block R Up pressed, then MyBlock

The best thing about IQ blocks is that you don’t need to use a forever loop at all, event blocks will do the trick. It’s really easy for the kids to do it that way. If you need more examples I can show you from my computer tomorrow.

1 Like