气动#

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

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

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

初始化气动类#

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

Pneumatic(port)

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

范围

描述

port

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

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

This pneumatic_1 object will be used in all subsequent examples throughout this API documentation when referring to Pneumatic class methods.

类方法#

open()#

The open() method sets the pneumatic valve to open.

**返回:**无。

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

# Close the pneumatics.
pneumatic_1.close()

close()#

The close() method sets the pneumatic valve to close.

**返回:**无。

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

# Close the pneumatics.
pneumatic_1.close()