VEX V5 C++ API
Public Member Functions | List of all members
vex::servo Class Reference

Use this class when programming with a servo device. More...

Inherits vex::__tridevice.

Public Member Functions

 servo (triport::port &port)
 Creates a new servo object on the port specified in the parameter. More...
 
 ~servo ()
 
void position (int32_t value, percentUnits units)
 Sets the position of the servo device. More...
 
void position (double value, rotationUnits units)
 Sets the position of the servo device. More...
 

Detailed Description

Use this class when programming with a servo device.

Constructor & Destructor Documentation

◆ servo()

vex::servo::servo ( triport::port port)

Creates a new servo object on the port specified in the parameter.

Parameters
portA reference to a three wire port.

◆ ~servo()

vex::servo::~servo ( )

Member Function Documentation

◆ position() [1/2]

void vex::servo::position ( int32_t  value,
percentUnits  units 
)

Sets the position of the servo device.

Parameters
valueSets the amount of rotation in the range [-100 to 100].
unitsThe measurement unit for the rotation value.

◆ position() [2/2]

void vex::servo::position ( double  value,
rotationUnits  units 
)

Sets the position of the servo device.

Parameters
valueSets the amount of rotation in the range [-50 deg to 50 deg].
unitsThe measurement unit for the rotation value.