Using Broadcast in VEX Pro V5 (Tipping Point)

Hey Everyone,

My team is trying to figure out how to use the “broadcast” command in text. We originally wanted our lift at the back of our robot to extend fully while driving forwards. We got it to work in blocks, but not in text. We tried copying and pasting the code, rewriting in text and even using the example in the command help for broadcasting in text.

We constantly got an an error where we are not able to use the curly brackets after the void line and undeclared identifier.

Here is an example of using the example code in the competition template:

Here’s the example code:

Broadcast Example code

If anyone could help that would be great.

It looks like You have an unmatched “} “ in that first picture ( because it is highlighting the { you might want to count the curly brackets and make sure you have the correct amount)

1 Like

You are declaring your functions in the wrong place, looks like in another function. You cannot do this, and when you are calling myEvent(), it can’t find runOnBroadcast1 and runOnBroadcast2 because they are out of scope. Instead, declare them outside of all other functions, such as right above main().

1 Like

Alright, here is the actual code that we are trying to use. We were trying the example code to see if we could even get that to work.

This is my second year in vex and the first time using text, I’m not 100% sure of what I’m doing. The void lines are copied from blocks, not sure why it says “onevent”.

Please let me know where I should put what. There is still the error of the “{” not allowed along with undeclared identifier in the main. The code is in the usercontrol of the competition template.

Thank you

main

Move the onevent_deploy_mogo_0() and the onevent_retract_mogo_0() to right above the usercontrol(). That will also fix the error with {.

1 Like

Ok thank you very much, that helped with the { error.

I still have an error at the end in the main. It says use of undeclared identifier. Do I even need those two lines that are causing the error?

image

Move the events out of your usercontrol and put them outside with your broadcast functions.

1 Like

Thank you so much for all your help! It compiled