neumático#
Inicializando la clase neumática#
Un sistema neumático se crea utilizando el siguiente constructor:
The pneumatic
constructor creates a pneumatic object in the specified Port.
Parámetro |
Descripción |
---|---|
|
Un Puerto inteligente válido al que está conectado el solenoide neumático. |
|
Un valor booleano que representa si se debe habilitar o deshabilitar la bomba de aire. |
// Construct a Pneumatic System "Pneumatic" with the
// pneumatic class.
pneumatic Pnuematic = pneumatic(PORT1);
This Pneumatic
object will be used in all subsequent examples throughout this API documentation when referring to pneumatic class methods.
Métodos de clase#
extend()#
The extend(value)
method extends a cylinder.
Parámetros |
Descripción |
---|---|
valor |
Un cylinderType válido. |
Devoluciones: Ninguna.
// Extend the first cylinder.
Pneumatic.extend(cylinder1);
// Wait 2 seconds.
wait(2, seconds);
// Retract the first cylinder.
Pneumatic.retract(cylinder1);
retract()#
The retract(value)
method retracts a cylinder.
Parámetros |
Descripción |
---|---|
valor |
Un cylinderType válido. |
Devoluciones: Ninguna.
// Extend the first cylinder.
Pneumatic.extend(cylinder1);
// Wait 2 seconds.
wait(2, seconds);
// Retract the first cylinder.
Pneumatic.retract(cylinder1);
pumpOn()#
The pumpOn()
method turns the pneumatic air pump on.
Devoluciones: Ninguna.
// Turn air pump on.
Pneumatic.pumpOn();
pumpOff()#
The pumpOff()
method turns the pneumatic air pump off.
Devoluciones: Ninguna.
// Turn air pump off.
Pneumatic.pumpOff();
pump()#
The pump(state)
method turns the pneumatic air pump on or off.
Parámetros |
Descripción |
---|---|
estado |
The compressor state. |
Devoluciones: Ninguna.
// Turn air pump on.
Pneumatic.pump(true);
wait(3, seconds);
// Turn air pump off.
Pneumatic.pump(false);
timestamp()#
The timestamp()
method requests the timestamp of the last received status packet from the Pneumatic System.
Devuelve: Marca de tiempo del último paquete de estado como un entero de 32 bits sin signo en milisegundos.
installed()#
The installed()
method checks for device connection.
Returns: true
if the device is connected. false
if it is not.