Hi, it appears that the new VEXcode (C++, V5) API docs appear to have an example that won’t compile.
The Motor docs have this example:
// Construct a V5 Motor that runs in reverse.
motor Motor1 = motor(PORT1, True);
// Construct a V5 Motor with a 6:1 Turbo Gear Cartridge.
motor Motor1 = motor(PORT1, ratio6_1);
// Construct a V5 Motor with a 36:1 Torque Gear Cartridge
// that runs in reverse.
motor Motor1 = motor(PORT1, ratio36_1, reverse);
The third constructor to motor appears to pass a vex::directionType
rather than a bool
(assuming this isn’t a pre-existing variable), which is incorrect for the constructor’s signature:
/**
* @brief Creates a new motor object on the port specified Sets the reversed flag and the gear setting for the new motor object.
* @param index The port index for this motor. The index is zero-based.
* @param gears Sets the gear's setting for the new motor object.
* @param reverse Sets the reverse flag for the new motor object.
*/
motor( int32_t index, gearSetting gears, bool reverse );
Also, just as a general observation - it seems like many references to structs and types appear to use pascal case rather than camel case (probably a mixup between the Python API’s naming scheme compared to the C++ ones):