气动#

气动命令仅适用于 CTE 气动部件。

要使气动命令出现在 VEXcode V5 中,必须在设备窗口中配置光学传感器。

欲了解更多信息,请参阅本文:

初始化气动类#

使用以下构造函数创建气动系统:

气动(端口)

此构造函数使用一个参数:

范围

描述

端口

与气动电磁阀连接的有效 智能端口

# Construct a Pneumatic System "pneumatic_1" with the
# Pneumatic class.
pneumatic_1 = Pneumatic(Ports.Port1)

当引用气动类方法时,此“pneumatic_1”对象将在整个 API 文档的所有后续示例中使用。

类方法#

open()#

open() 方法将气动阀设置为打开。

**返回:**无。

# Open the pneumatics for 2 seconds.
pneumatic_1.open()
wait(2, SECOND)

# Close the pneumatics.
pneumatic_1.close()

close()#

close() 方法将气动阀设置为关闭。

**返回:**无。

# Open the pneumatics for 2 seconds.
pneumatic_1.open()
wait(2, SECOND)

# Close the pneumatics.
pneumatic_1.close()