V5气动系统#

介绍#

VEX V5 控制器可以通过 Pneumatics 的方法控制 V5 气动系统。这些方法允许控制器打开或关闭系统,伸缩气缸。

您需要手动创建类才​​能使其正常工作。

本页面使用 v5_pneumatic 作为 V5 气动系统的示例名称。请根据需要将其替换为您自己配置的名称。

以下是可用方法列表:

操作 – 控制气缸。

  • open – 延伸圆柱体。

  • close – 缩回一个圆柱体。

构造函数 - 手动初始化和配置 V5 气动电磁阀。

行动#

open#

open 伸出一个圆柱体。

用法:

v5_pneumatic.open()

参数

描述

此方法没有参数。

# Extend the first cylinder
v5_pneumatic.open()

# Wait 2 seconds
wait(2, SECONDS)

# Retract the first cylinder
v5_pneumatic.close()

close#

close 缩回气缸。

Usage:
v5_pneumatic.close()

参数

描述

此方法没有参数。

# Extend the first cylinder
v5_pneumatic.open()

# Wait 2 seconds
wait(2, SECONDS)

# Retract the first cylinder
v5_pneumatic.close()

构造函数#

构造函数用于手动创建 Pneumatics 对象,这些对象是配置 V5 气动电磁阀所必需的。

Pneumatics#

Pneumatics 生成 V5 气动电磁阀。

Usage:
Pneumatics(port)

范围

描述

port

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

  • On the V5 Brain – Ports.PORTx where x is the number of the port.
  • On a 3-Wire Expander – expander.a where expander is the name of the expander instance.

# Create a V5 Pneumatic Solenoid in Port A
v5_pneumatic = Pneumatics(brain.three_wire_port.a)