伺服电机#
介绍#
VEX 三线伺服电机 是一款三线设备,可以根据 V5 控制器的控制信号旋转到特定位置。

This page uses servo_motor as the example Servo Motor name. Replace it with your own configured name as needed.
以下是可用方法列表:
set_position– Rotates a Servo Motor to a specified angle between 0 and 100 degrees.
构造函数 - 手动初始化伺服电机。
Servo– Creates a Servo Motor.
设置位置#
set_position rotates a Servo Motor to a specified angle between 0 and 100 degrees.
**注意:**伺服电机在开始每个项目之前,都会自动将自身居中于 50 度,然后再进行任何运动。

Usage:
servo_motor.set_position(value, units)
参数 |
描述 |
|---|---|
|
伺服电机旋转到的位置,可以是浮点数或整数。 |
|
The unit that represents the positional value:
|
构造函数#
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)
范围 |
描述 |
|---|---|
|
The 3-Wire Port that the V5 Pneumatic Solenoid is connected to:
|
# Create a Servo Motor in Port A
servo_motor = Servo(brain.three_wire_port.a)