No idea where to start with autonomous programming

I’m new to vex this year and I have no idea where to start with the autonomous program I have programmed a basic driving script but I don’t know where to start with the autonomous code. (I’m using c++ ) any help would be greatly appreciated!

If you’re new to Vex, I would start out with block coding and get the hang of that first.

2 Likes

I do have prior experience with programming and am working fairly comfortably in c++

Start by defining what you want your auto to do. Push a triball? spin in a circle?

Once you define the task(s) you want the robot to do, write pseudocode to do the task, and then convert the pseudocode to C++

So its really just like:

Spin motor for x amount of time
wait
repeat?

Read thru the API. While time-based movements can work, often teams find using other methods, such as moving the motor to a specific position, can be more reliable. Once you master the basics, there’s a whole world of control-theory to improve the reliability of the robot’s movements. But crawl-walk-run your way there.

1 Like

I have my students start with Block code just so they get an idea of the coding convention.

Use this URL to do some testing: https://codev5.vex.com/

Open up the examples (under the File heading) and look for the Waiting Between Commands project. You can set up a simple drivetrain and the drop blocks under the yellow events tab.

Click on the code preview button in the upper right and you will have c++ or python examples of your sample code as a reference.

You can even convert it to a separate text project as a boilerplate to get you started.

Here:

There’s a 3 min into giving background on why, how, etc for this approach.

Coding begins at 2:55 approx.

I encourage you to watch the intro though.

Same thing in iq:

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.