Neumático#
Introducción#
El sistema neumático utiliza una bomba de aire y un solenoide para controlar el aire comprimido que mueve los cilindros. Permite activar o desactivar la bomba y extender o retraer los cilindros mediante código.
This page uses Pneumatic1 as the example Pneumatic System name. Replace it with your own configured name as needed.
A continuación se muestra una lista de los métodos disponibles:
Acciones: Comprimir o descomprimir el aire con una bomba de aire.
extend– Extend a cylinder.retract– Retract a cylinder.pumpOn– Turn on the air pump.pumpOff– Turn off the air pump.pump– Set the on or off state of the air pump.
Getters – Comprueba si el solenoide está conectado.
installed– Returns whether or not a solenoid is connected to the Brain.
Constructores: inicializan y configuran manualmente la neumática.
pneumatic– Creates a Pneumatics object.
Comportamiento#
extend#
extend extends a cylinder.
Usage:
Pneumatic1.extend(id);
Parámetros |
Descripción |
|---|---|
|
The cylinder to extend:
|
retract#
retract retracts a cylinder.
Usage:
Pneumatic1.retract(id);
Parámetros |
Descripción |
|---|---|
|
The cylinder to extend:
|
pumpOn#
pumpOn turns the air pump on.
Usage:
Pneumatic1.pumpOn();
Parámetros |
Descripción |
|---|---|
Este método no tiene parámetros. |
pumpOff#
pumpOff turns the air pump off.
Usage:
Pneumatic1.pumpOff();
Parámetros |
Descripción |
|---|---|
Este método no tiene parámetros. |
pump#
pump turns the air pump on or off.
Usage:
Pneumatic1.pump(state);
Parámetros |
Descripción |
|---|---|
|
The air pump state:
|
Captadores#
installed#
installed returns a Boolean indicating whether the solenoid is connected to the Brain.
1- The solenoid is connected to the Brain.0- The solenoid is not connected to the Brain.
Usage:
Pneumatic1.installed()
Parámetros |
Descripción |
|---|---|
Este método no tiene parámetros. |
Constructores#
pneumatic#
pneumatic creates an object of the pneumatic Class in the specified port.
Default Usage:
pneumatic Pneumatic1 = pneumatic(smartport);
Overload Usages:
pneumatic Pneumatic1 = pneumatic(smartport, bPumpEnable);
Parámetro |
Descripción |
|---|---|
|
The Smart Port that the Pneumatic Solenoid is connected to, written as PORTx where x is the number of the port. |
|
A Boolean representing whether to enable or disable the air pump: true – The air pump is set to on at the start of a project. false – The air pump is set to off at the start of the project. |
int main() {
// Initializing Robot Configuration. DO NOT REMOVE!
vexcodeInit();
// Create a Pneumatics object in Port 3
pneumatic myPneumatic = pneumatic(PORT3);
// Create another in Port 4 that starts with pump enabled
pneumatic PumpOnPneumatic = pneumatic(PORT4, true);
}