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 |
|---|---|---|
|
|
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 Functionsvoid extend(
cylinderType id );
Parámetro |
Tipo |
Descripción |
|---|---|---|
|
|
The cylinder to extend:
|
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 Functionsvoid retract(
cylinderType id );
Parámetro |
Tipo |
Descripción |
|---|---|---|
|
|
The cylinder to retract:
|
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 Functionsvoid pump_on();
Esta función no tiene parámetros.
Return ValuesEsta función no devuelve ningún valor.
Examples// Turn the pneumatic pump on
ctePneumatic1.pump_on();
pump_off#
Apaga la bomba neumática.
Available Functionsvoid pump_off();
Esta función no tiene parámetros.
Return ValuesEsta 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 Functionsvoid pump(
bool state );
Parámetro |
Tipo |
Descripción |
|---|---|---|
|
|
The state to set: |
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 Functionsbool installed();
Esta función no tiene parámetros.
Return ValuesDevuelve un valor booleano que indica si el solenoide está conectado al sistema de control o no.
trueif the solenoid is connected to the Brain.falseif the solenoid is not connected to the Brain.
// Check if the pneumatic solenoid is connected
if (ctePneumatic1.installed()) {
// Pneumatic system is ready
ctePneumatic1.pump_on();
}