VEX V5 Motor Encoders

I have used encoders with Cortex and Robotc to move straight and move for a distance.

I have a team using VEXcode Blocks, and I understand that V5 motors have builtin encoders. I am struggling finding example code on how to move straight with VEXcode Block. Any help would be greatly appreciated.

Molly

Easiest thing is to add a “drivetrain” device in the devices menu. That will provide you with blocks to drive the robot straight for a particular distance (in inches or mm) and to turn through a specified angle.

One downside of the drivetrain object in VEXcode blocks is that if you use the drivetrain object, you lose the ability to address the drive motors individually. If you instead want to configure the motors individually you could do something like this:

1 Like