CTE气动系统#

介绍#

CTE气动指令仅适用于CTE气动部件。您需要手动导入CTE模块才能使其正常工作。

from cte import *

The VEX V5 Brain can control the CTE 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 cte_pneumatic as the example CTE Pneumatics name. Replace it with your own configured name as needed.

以下是可用方法列表:

操作 – 控制气缸和气动泵。

  • extend – Extends a pneumatic cylinder.

  • retract – Retracts a pneumatic cylinder.

  • pump_on – Turns the pneumatic pump on.

  • pump_off – Turns the pneumatic pump off.

设置人员——打开或关闭气动泵。

  • pump – Turns the pneumatic pump on or off.

施工人员 – 手动初始化和配置 CTE 气动电磁阀。

  • Pneumatic – Create a CTE Pneumatic Solenoid.

行动#

extend#

extend extends a pneumatic cylinder.

Usage:
cte_pneumatic.extend(cylinder)

参数

描述

cylinder

The cylinder to extend:

  • CYLINDER1
  • CYLINDER2
  • CYLINDER3
  • CYLINDER4
  • CYLINDERALL – All 4 cylinders

retract#

retract retracts a pneumatic cylinder.

Usage:
cte_pneumatic.retract(cylinder)

参数

描述

cylinder

The cylinder to retract:

  • CYLINDER1
  • CYLINDER2
  • CYLINDER3
  • CYLINDER4
  • CYLINDERALL – All 4 cylinders

pump_on#

pump_on turns the pneumatic pump on.

Usage:
cte_pneumatic.pump_on()

参数

描述

此方法没有参数。

pump_off#

pump_off turns the pneumatic pump off.

用法:

cte_pneumatic.pump_off()

参数

描述

此方法没有参数。

二传手#

pump#

pump turns the pneumatic pump on or off.

用法:

cte_pneumatic.pump(state)

参数

描述

state

The state to set: True turns the pneumatic pump on, and False turns the pneumatic pump off.

构造函数#

Constructors are used to manually create Pneumatic objects, which are necessary for configuring a CTE Pneumatic Solenoid.

Pneumatic#

Pneumatic creates a CTE Pneumatic Solenoid.

Usage:
Pneumatic(smartport)

范围

描述

smartport

The Smart Port that the CTE Pneumatic Solenoid is connected to, written as Ports.PORTx where x is the number of the port.

from cte import *

# Create a CTE Pneumatic Solenoid in Port 1
cte_pneumatic = Pneumatic(Ports.PORT1)