Help with my auton

So i’m coding my robot rn and I want to have multiple codes under one drive code and i’ve seen other teams do it where you can select the code on the brain screen without having to download another code they just click

I would recommend you use the search option “Autonomous Code Selector” and you will find plenty of approaches to this.

4 Likes

So I’ve looked into most of them and I can’t seem to figure out where the actual code is in them and how to code it i’m trying to just get 8 buttons that don’t alter my code but select my code

Read this, see if it helps:

1 Like

Ok so every time I look into that nothing shows up when I click on the links but I got a friend to do it and he said that the code shown would be for pros but I code in vex code v5 c++

Interesting, it compiles for me using VEXcode Pro (the one that does C++).

Did you import the project as noted by the “solution” in the post. It had been developed under the original VEX coding studio way back when V5 was released.

Did you want to go for an autonomous selector like this one?

1 Like

Not sure if this is what he’s looking for, but do you mind sharing the method for this?

You just have to draw out 6 rectangles on the brain in the pre-autonomous section, and then program each rectangle to act as a button through if-else statements. This way, when the brain is pressed in a certain location, it will run code or draw something on the brain screen. That’s pretty much it.

I can also show you my program if you wanted to analyze it.

I think that would be great if you could send it to me. Thank you!

Here is my program for my autonomous selector…

1 Like

Thank you, this is very helpful. However, I’m not that well acquainted with text, do you think there is any way you could convert the program to block?

I didn’t have the boxes drawn correctly in my previous post. Admins can delete the previous.

Here is one example using blocks.

2 Likes

Thank you so much! This has really helped me! I did notice that you used the variable “AutonNumber”. I would like to ask you what type of variable it is? I also saw that you mentioned “Default Auton code” and didn’t know what that quite meant apart from the Red and Blue autonomous.

AutonNumber is an integer (number)

The default auton would be the action taken if no button were pressed. On that note, it would also need to be set equal to zero (is currently 1) in the When Started section for the Default to be called.