How to code 2 motors to work together (1 forward & 1 reverse)

My son is trying to learn how to code 2 motors in a vex IQ 4 motor drivetrain. We are trying to use them in pairs connected by cogs so that one goes forwards and the other in reverse. We would be very grateful of any assistance as we are novices! If there is any help or advice you can offer a then please can you send them in Thanks (He preferably would use vex code IQ for this)

We are using a Vex IQ second generation kit and he really needs help

probably create a “motor group” for the pair of motors, I expect someone will post example code for you. In the mean time, if you have not already found these resources, lots on info on IQ here.

and VEXcode APIs here

Welcome to VexForum!

As said earlier, you can create a motor group to move two motors while being treated as one:

If you are talking about using 2 motors as a drivetrain, then there is a 2 motor drivetrain option:

Now here is the example with initialized motor group and drivetrain (2 motor, change to 4 if you want). You can change the motor ports, names, and directions as needed:
VEXcode Project.iqblocks (1.1 KB)