Servo Motor#

Introduction#

The VEX 3-Wire Servo Motor is a 3-wire device that can rotate to a specific position based on a control signal from the V5 Brain.

The EDR VEX Servo Motor

This page uses servo_motor as the example Servo Motor name. Replace it with your own configured name as needed.

Below is a list of available methods:

  • set_position – Rotates a Servo Motor to a specified angle between 0 and 100 degrees.

Constructor – Manually initialize a Servo Motor.

  • Servo – Creates a Servo Motor.

set_position#

set_position rotates a Servo Motor to a specified angle between 0 and 100 degrees.

Note: A Servo Motor begins each project by automatically centering itself at 50 degrees before completing any movements.

A diagram of a servo motor showing the degrees that it can rotate, from 100 to 0 degrees.

Usage:
servo_motor.set_position(value, units)

Parameters

Description

value

The position to spin the Servo Motor to as a float or integer.

units

The unit that represents the positional value:

  • DEGREES
  • PERCENT (default)

Constructors#

Constructors are used to manually create Servo objects, which are necessary for configuring a Servo Motor outside of VEXcode.

Servo#

Servo creates a Servo Motor.

Usage:
Servo(port, gears, reverse)

Parameter

Description

port

The 3-Wire Port that the V5 Pneumatic Solenoid is connected to:

  • On the V5 BrainPorts.PORTx where x is the number of the port.
  • On a 3-Wire Expanderexpander.a where expander is the name of the expander instance.

# Create a Servo Motor in Port A
servo_motor = Servo(brain.three_wire_port.a)