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)