기학#

소개#

VEX EXP 브레인은 pneumatic 클래스를 사용하여 CTE 공압 시스템을 제어할 수 있습니다. 이 클래스를 통해 브레인은 공압 펌프를 제어하고 공압 실린더를 확장 또는 수축시킬 수 있습니다.

참고: 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 (공압 펌프 켜짐), 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();
}