Looking for cool programming tricks

Motorgroup is your friend @LAMMAZ

vex::motor LT (vex::PORT1);
vex::motor LB (vex::PORT2);
vex::motor RT (vex::PORT3,true);
vex::motor RB (vex::PORT4,true);

vex::motor_group left (LT , LB);
vex::motor_group right (RT , RB);

You can then say

left.spin(fwd,100,velocityUnits::pct);

And both motors specified in the group will move. Jpearman posted about it here when the commands were first introduced.

4 Likes