空気圧#

導入#

VEX EXP Brainは、 pneumatic クラスを使用してCTE Pneumaticシステムを制御できます。このクラスにより、Brainは空気圧ポンプを制御し、空気圧シリンダーを伸縮させることができます。

注: CTE 空圧コマンドには CTE モジュールが必要です。 using namespace cte;を使用してインポートします。

クラスコンストラクタ#

pneumatic( 
  int32_t index );

クラスデストラクタ#

pneumatic オブジェクトを破壊し、関連するリソースを解放します。

~pneumatic();

パラメータ#

パラメータ

タイプ

説明

index

int32_t

CTE空圧ソレノイドが接続されているスマートポート(例:PORT1)。

注記#

  • CTE Pneumaticのコマンドは、CTE Pneumatic製の部品でのみ動作します。

  • CTEモジュールを手動でインポートする必要があります: using namespace cte;。

  • このシステムは、最大4つのシリンダーを個別に、またはすべて同時に制御できます。

例#

using namespace cte;

// Create a CTE Pneumatic Solenoid in Port 1
pneumatic ctePneumatic1 = pneumatic(PORT1);

// Turn on the pump and extend cylinder 1
ctePneumatic1.pump_on();
ctePneumatic1.extend(cylinder1);

メンバーの機能#

extend#

空気圧シリンダーを伸長させる。

Available Functions
void extend( 
  cylinderType id );

Parameters

パラメータ

タイプ

説明

id

cylinderType

延長するシリンダー:

  • cylinder1
  • cylinder2
  • cylinder3
  • cylinder4
  • cylinderAll – 4 シリンダーすべて

Return Values

この関数は値を返しません。

Examples
// Extend cylinder 1
ctePneumatic1.extend(cylinder1);

// Extend all cylinders
ctePneumatic1.extend(cylinderAll);

retract#

空気圧シリンダーを格納します。

Available Functions
void retract( 
  cylinderType id );

Parameters

パラメータ

タイプ

説明

id

cylinderType

引き込むシリンダー:

  • cylinder1
  • cylinder2
  • cylinder3
  • cylinder4
  • cylinderAll – 4つのシリンダーすべて

Return Values

この関数は値を返しません。

Examples
// Retract cylinder 2
ctePneumatic1.retract(cylinder2);

// Retract all cylinders
ctePneumatic1.retract(cylinderAll);

pump_on#

空気圧ポンプのスイッチを入れる。

Available Functions
void pump_on();

Parameters

この関数には引数がありません。

Return Values

この関数は値を返しません。

Examples
// Turn the pneumatic pump on
ctePneumatic1.pump_on();

pump_off#

空気圧ポンプを停止します。

Available Functions
void pump_off();

Parameters

この関数には引数がありません。

Return Values

この関数は値を返しません。

Examples
// Turn the pneumatic pump off
ctePneumatic1.pump_off();

pump#

空気圧ポンプのオン/オフを切り替えます。

Available Functions
void pump( 
  bool state );

Parameters

パラメータ

タイプ

説明

state

bool

設定する状態: true 空気圧ポンプをオンにします。2 false 空気圧ポンプをオフにします。

Return Values

この関数は値を返しません。

Examples
// Turn the pump on
ctePneumatic1.pump(true);

// Turn the pump off
ctePneumatic1.pump(false);

installed#

CTE空気圧ソレノイドがブレインに接続されているかどうかを返します。

Available Functions
bool installed();

Parameters

この関数には引数がありません。

Return Values

ソレノイドがブレインに接続されているかどうかを示すブール値を返します。

  • true ソレノイドが脳に接続されている場合。

  • false ソレノイドがブレインに接続されていない場合。

Examples
// Check if the pneumatic solenoid is connected
if (ctePneumatic1.installed()) {
  // Pneumatic system is ready
  ctePneumatic1.pump_on();
}