气动#

介绍#

气动系统使用气泵和电磁阀来控制移动气缸的压缩空气。它可以通过代码打开或关闭气泵,并伸缩气缸。

For the examples below, the configured Pneumatics system will be named Pneumatics1, and will be used in all subsequent examples throughout this API documentation when referring to Pneumatic class methods.

以下是可用方法的列表:

动作——用气泵压缩或减压空气。

  • extend – Extend a cylinder.

  • retract – Retract a cylinder.

  • pumpOn – Turn on the air pump.

  • pumpOff – Turn off the air pump.

  • pump – Set the on or off state of the air pump.

吸气剂 – 检查螺线管是否连接。

  • installed – Returns whether or not a solenoid is connected to the Brain.

构造函数——手动初始化和配置气动装置。

行动#

extend#

extend extends a cylinder.

Usage:
Pneumatic1.extend(id);

参数

描述

id

The cylinder to extend:

  • cylinder1
  • cylinder2
  • cylinderALL – Both cylinders
// Example coming soon

retract#

retract retracts a cylinder.

Usage:
Pneumatic1.retract(id);

参数

描述

id

The cylinder to extend:

  • cylinder1
  • cylinder2
  • cylinderALL – Both cylinders
// Example coming soon

pumpOn#

pumpOn turns the air pump on.

Usage:
Pneumatic1.pumpOn();

参数

描述

该方法没有参数。

// Example coming soon

pumpOff#

pumpOff turns the air pump off.

Usage:
Pneumatic1.pumpOff();

参数

描述

该方法没有参数。

// Example coming soon

pump#

pump turns the air pump on or off.

Usage:
Pneumatic1.pump(state);

参数

描述

state

The air pump state:

  • true – Turn the air pump on.
  • false – Turn the air pump off.
// Example coming soon

吸气剂#

installed#

installed returns a Boolean indicating whether the solenoid is connected to the Brain.

  • 1 - The solenoid is connected to the Brain.

  • 0 - The solenoid is not connected to the Brain.

Usage:
Pneumatic1.installed()

参数

描述

该方法没有参数。

// Example coming soon

构造函数#

pneumatic#

pneumatic creates an object of the pneumatic Class in the specified port.

Default Usage:
pneumatic Pneumatic1 = pneumatic(port);

Overload Usages:
pneumatic Pneumatic1 = pneumatic(port, bPumpEnable);

范围

描述

port

Which Smart Port that the Pneumatic Solenoid is connected to as PORT followed by the port number, ranging from 1 to 12.

bPumpEnable

A Boolean representing whether to enable or disable the air pump:

  • true – The air pump is set to on at the start of a project.
  • false – The air pump is set to off at the start of the project.
    // Example coming soon