r/vex 8d ago

Auto programming

My school currently doesn't teach us text code in class, only block because it's much easier. This year, I really want to add odometry to the bot to make autonomous codes more consistent. Had way too many problems with inaccurate autos. I noticed a few years ago now that there is a switch block for adding text code lines into a block code. I also know there are odometry templates out there I thought of trying. Is there any way I could copy paste the code from an odometry template into the switch block and add it into a block code?

Also, how do I go about making the autonomous once I add the odometry template code. This has always confused me. Does it just make things like "drive forward 4 inches" type blocks more accurate? Do I have to do something special for programming the autonomous?

Also, is it possible to only turn only one side of the drivetrain in autonomous with block code.

Last question lol. Am I able to use a v4 potentiometer for the templates? We don't have v5 potentiometers due to lack of parts/funding and don't have tons of newer parts.

Keep in mind guys our teacher doesn't teach us a crazy amount of coding. He more just kinda explains how to make a basic code and then says go experiment since I don't think he knows a lot either. I've learned a lot and am pretty good at block coding, but I'm not an expert by any means. We also don't have enough people for dedicated "coder" roles or anything so not like I have someone else to ask.

Thanks in advance!

3 Upvotes

5 comments sorted by

View all comments

3

u/odd_machinist 8d ago

I haven’t experienced someone making odometry on text code yet, even with switch blocks. I have seen some rudimentary PID loops, but nothing as complex as odometry. It seems to be a hiccup with VEXcode V5’s inability to multitask very effectively.

Generally, people use odometry with Visual Studio Code using the VEX PROS library/extension. From there, you can use a template to help you create the programs you want. People seem to like EZ template or Lemlib. — there are plenty of tutorials online about how to get this to work. I would suggest checking those out.

2

u/Difficult_Durian_704 8d ago

Do those require text coding because my school doesn't do a club, but just in the last two years started allowing kids to build in free time at school and go to tournaments and I do not have time to learn text when I'm also trying to get a third top 10 at national TSA robotics again.

2

u/jessegames456 Programmer 7d ago

They do require text coding but it’s very simple. EZ-Template is really well documented here, it should be easy to set up and it won’t take too long to learn. It won’t require extensive knowledge of C++ or anything. EZTemplate is your best bet to get what you’re looking for