Neumática#

Introducción#

The VEX EXP Brain can control the CTE Pneumatic system using the pneumatic class. This class allows the Brain to control the pneumatic pump and extend or retract pneumatic cylinders.

Note: CTE Pneumatic commands require the CTE module. Import it using using namespace cte;.

Constructores de clases#

pneumatic( 
  int32_t index );

Instructor de clase#

Destroys the pneumatic object and releases associated resources.

~pneumatic();

Parámetros#

Parámetro

Tipo

Descripción

index

int32_t

El puerto inteligente al que está conectado el solenoide neumático CTE (por ejemplo, PORT1).

Notas#

  • Los comandos de CTE Pneumatic solo funcionarán con las piezas de CTE Pneumatic.

  • You must manually import the CTE module: using namespace cte;.

  • El sistema puede controlar hasta 4 cilindros individualmente o todos a la vez.

Ejemplo#

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);

Funciones de los miembros#

extend#

Extiende un cilindro neumático.

Available Functions
void extend( 
  cylinderType id );

Parameters

Parámetro

Tipo

Descripción

id

cylinderType

The cylinder to extend:

  • cylinder1
  • cylinder2
  • cylinder3
  • cylinder4
  • cylinderAll – All 4 cylinders

Return Values

Esta función no devuelve ningún valor.

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

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

retract#

Retrae un cilindro neumático.

Available Functions
void retract( 
  cylinderType id );

Parameters

Parámetro

Tipo

Descripción

id

cylinderType

The cylinder to retract:

  • cylinder1
  • cylinder2
  • cylinder3
  • cylinder4
  • cylinderAll – All 4 cylinders

Return Values

Esta función no devuelve ningún valor.

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

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

pump_on#

Enciende la bomba neumática.

Available Functions
void pump_on();

Parameters

Esta función no tiene parámetros.

Return Values

Esta función no devuelve ningún valor.

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

pump_off#

Apaga la bomba neumática.

Available Functions
void pump_off();

Parameters

Esta función no tiene parámetros.

Return Values

Esta función no devuelve ningún valor.

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

pump#

Enciende o apaga la bomba neumática.

Available Functions
void pump( 
  bool state );

Parameters

Parámetro

Tipo

Descripción

state

bool

The state to set: true turns the pneumatic pump on. false turns the pneumatic pump off.

Return Values

Esta función no devuelve ningún valor.

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

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

installed#

Indica si el solenoide neumático CTE está conectado al cerebro.

Available Functions
bool installed();

Parameters

Esta función no tiene parámetros.

Return Values

Devuelve un valor booleano que indica si el solenoide está conectado al sistema de control o no.

  • true if the solenoid is connected to the Brain.

  • false if the solenoid is not connected to the Brain.

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