Robot Config: Smart Motor - VEXcode

Step 1: Open a Project

  • Open a project in VEXcode.

Step 2: Modify the main.cpp File

There are two formats to declare a Smart Motor, though each format requires a device type, name, port, and motor direction.

  • The first format shown in the image above is the condensed format.
    • The device type will always be vex::motor.
    • The device name can be any name not already used by the program.
    • The device port and motor direction need to be in parenthesis right after the motor’s name. The port will always start with vex::PORT and can be assigned to numbers 1-21.
    • The motor direction is assigned by a true/false value. Setting the value to false will cause the motor to rotate forward, and a true value will set the motor to rotate in reverse.
  • The second format shown in the image above is the full format on how to declare a Smart Motor.
    • The device type will always be vex::motor.
    • The device name can be any name not already used by the program.
    • The device port and motor direction are typed out the same way as the first format, just preceded by = vex::motor.

Still need help? Contact Us Contact Us