Neumática#
Introducción#
The VEX IQ Brain can control the VEX IQ Pneumatic system using the pneumatics class. This class allows the Brain to control the pneumatic pump and extend or retract pneumatic cylinders.
Constructores de clases#
pneumatics(
int32_t index );
Instructor de clase#
Destroys the pneumatics object and releases associated resources.
~pneumatics();
Parámetros#
Parámetro |
Tipo |
Descripción |
|---|---|---|
|
|
The Smart Port that the Pneumatic Solenoid is connected to, written as |
Ejemplo#
// Create the pneumatics instance on Port 1
pneumatics Pneumatic1 = pneumatics(PORT1);
Funciones de los miembros#
The pneumatics class includes the following member functions:
extend— Extend a cylinder.retract— Retract a cylinder.pump_on— Turns the pneumatic pump on.pump_off— Turns the pneumatic pump off.pump— Turns the pneumatic pump on or off.installed— Returns whether or not the solenoid is connected to the brain.
Before calling any pneumatics member functions, a pneumatics instance must be created, as shown below:
/* This constructor is required to use an
IQ Pneumatics Solenoid. Replace the values
as needed. */
// Create the pneumatics instance on Port 1
pneumatics Pneumatic1 = pneumatics(PORT1);
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
Pneumatic1.extend(cylinder1);
// Extend all cylinders
Pneumatic1.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
Pneumatic1.retract(cylinder2);
// Retract all cylinders
Pneumatic1.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
Pneumatic1.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
Pneumatic1.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
Pneumatic1.pump(true);
// Turn the pump off
Pneumatic1.pump(false);
installed#
Indica si el solenoide neumático 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 (Pneumatic1.installed()) {
// Pneumatic system is ready
Pneumatic1.pump_on();
}