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.
For the examples below, the configured Pneumatic Solenoid will be named pneumatic_1 and will be used in all subsequent examples throughout this API documentation when referring to Pneumatic class methods.
A continuación se muestra una lista de los métodos disponibles:
Acciones: Comprimir o descomprimir el aire con una bomba de aire.
Mutadores: comprimen o descomprimen el aire con una bomba de aire.
pump_on– Turn on the air pump.pump_off– 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:
pneumatic_1.extend(cylinder)
Parámetros |
Descripción |
|---|---|
|
The cylinder to extend:
|
retract#
retract retracts a cylinder.
Usage:
pneumatic_1.retract(cylinder)
Parámetros |
Descripción |
|---|---|
|
The cylinder to retract:
|
Mutadores#
pump_on#
pump_on turns the air pump on.
Usage:
pneumatic_1.pump_on()
Parámetros |
Descripción |
|---|---|
Este método no tiene parámetros. |
pump_off#
pump_off turns the air pump off.
Usage:
pneumatic_1.pump_off()
Parámetros |
Descripción |
|---|---|
Este método no tiene parámetros. |
pump#
pump turns the air pump on or off.
Usage:
pneumatic_1.pump(state)
Parámetros |
Descripción |
|---|---|
|
The air compressor state:
|
Captadores#
installed#
installed returns a Boolean indicating whether the solenoid is connected to the Brain.
True- The solenoid is connected to the Brain.False- The solenoid is not connected to the Brain.
Usage:
pneumatic_1.installed()
Parámetros |
Descripción |
|---|---|
Este método no tiene parámetros. |
Constructores#
Constructors are used to manually create Pneumatic objects, which are necessary for configuring Pneumatics outside of VEXcode.
Pneumatics#
The Pneumatic constructor creates a Pneumatic object in the specified Smart Port:
Usage:
pneumatic_1 = Pneumatic(port)
Parámetro |
Descripción |
|---|---|
|
Which Smart Port that the solenoid is connected to as |
# Create a Pneumatic object in Port 1
pneumatic_1 = Pneumatic(Ports.PORT1)