All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Controlling motors

This describes the simplest way of controlling the motors connected to the cortex, the equivalent of the motor[] intrinsic in ROBOTC or the SetMotor function in EasyC. For more comprehensive motor control see the SetMotor function that is part of the smartMotor optional code.

Making the motors run

Motors are controlled using vexMotorSet

vexMotorSet( int16_t index, int16_t value )

The motor addressed by index is immediately set to the speed contained in the variable value.

index should be in the range 0 through 9, shortcuts are defined in the enumerated type tVexMotor

Finding out what speed a motor is running at

The current motor speed can be found by using

vexMotorGet( int16_t index )

This returbs the current motor speed in the range -127 to +127.