VEXcode programming how to run drivetrains

I can start one motor at a time without using full drivetrain but it’d be much easier to program this in distanceUnites (in/mm) rather than rotationUnits, but I have no idea how to program the drivetrain to just run like that, or even to make left and right motor go off of distance rather than rotation. There isn’t much help as most of this is new and I only have a basic understanding of this after using RobotC with IQ instead. Any help is appreciated.

Here is some code that does a conversion in another post. VexCode does not have an inherent distance measurement because it changes based on the circumference of your wheels. You could code your own unit for rotationUnits. I don’t have VexCode with me right now but I am going to try and code it (no guarantees it is correct).

rotationUnits::in = rotationUnits::deg / 4; //replace 4 with wheel diameter.

Not sure how wrong this is. Something similar to that.
You could probably search for wheel circumferences on the forum and get them for some wheels. The vex website might also have them. Keep in mind that there is experimental vs. actual wheel circumference so your measurements may be slightly off.

1 Like