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:
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)
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().
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.