气动#
介绍#
The VEX IQ Brain can control the VEX IQ Pneumatic system using methods from the Pneumatic class. These methods allow the Brain to control the pneumatic pump and extend or retract pneumatic cylinders.
This page uses pneumatic_1 as the example Pneumatic name. Replace it with your own configured name as needed.
以下是所有方法的列表:
动作——控制气缸。
变异器——开启或关闭气动泵。
pump_on— Turns the pneumatic pump on.pump_off— Turns the pneumatic pump off.pump— Turns the pneumatic pump on or off.
检查电磁阀是否已连接。
installed— Returns whether or not a solenoid is connected to the Brain.
构造函数——手动初始化和配置气动系统。
Pneumatic— Creates a Pneumatics object.
行动#
extend#
extend extends a pneumatic cylinder.
Usage:
pneumatic_1.extend(cylinder)
参数 |
描述 |
|---|---|
|
The cylinder to extend:
|
retract#
retract retracts a pneumatic cylinder.
Usage:
pneumatic_1.retract(cylinder)
参数 |
描述 |
|---|---|
|
The cylinder to retract:
|
修改器#
pump_on#
pump_on turns the pneumatic pump on.
Usage:
pneumatic_1.pump_on()
参数 |
描述 |
|---|---|
该方法没有参数。 |
pump_off#
pump_off turns the pneumatic pump off.
Usage:
pneumatic_1.pump_off()
参数 |
描述 |
|---|---|
该方法没有参数。 |
pump#
pump turns the pneumatic pump on or off.
Usage:
pneumatic_1.pump(state)
参数 |
描述 |
|---|---|
|
The state to set: |
吸气剂#
installed#
installed returns a Boolean indicating whether the solenoid is connected to the Brain.
True— The solenoid is connected to the Brain.False— The solenoid is not connected to the Brain.
Usage:
pneumatic_1.installed()
参数 |
描述 |
|---|---|
该方法没有参数。 |
构造函数#
Constructors are used to manually create Pneumatic objects, which are necessary for configuring Pneumatics outside of VEXcode.
Pneumatics#
The Pneumatic constructor creates a Pneumatic object in the specified Smart Port.
Usage:
pneumatic_1 = Pneumatic(smartport)
范围 |
描述 |
|---|---|
|
电磁阀连接的智能端口,记为 PORTx,其中 x 是端口编号。 |
# Create a Pneumatic object in Port 1
pneumatic_1 = Pneumatic(Ports.PORT1)