Neumático#
Los comandos neumáticos solo funcionarán con las piezas neumáticas CTE.
Inicializando la clase neumática#
Un sistema neumático se crea utilizando el siguiente constructor:
Pneumatic(port)
Este constructor utiliza un parámetro:
Parámetro |
Descripción |
---|---|
|
Un Puerto inteligente válido al que está conectado el solenoide neumático. |
# Construct a Pneumatic System "pneumatic_1" with the
# Pneumatic class.
pneumatic_1 = Pneumatic(Ports.Port1)
This pneumatic_1
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.
pnuematic_1.extend(CYLINDER1)
# Wait 2 seconds.
wait(2, SECONDS)
# Retract the first cylinder.
pnuematic_1.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.
pnuematic_1.extend(CYLINDER1)
# Wait 2 seconds.
wait(2, SECONDS)
# Retract the first cylinder.
pnuematic_1.retract(CYLINDER1)
pump_on()#
The pump_on()
method turns the pneumatic air pump on.
Devoluciones: Ninguna.
# Turn air pump on.
pnuematic_1.pump_on()
pump_off()#
The pump_off()
method turns the pneumatic air pump off.
Devoluciones: Ninguna.
# Turn air pump off.
pnuematic_1.pump_off()
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.
pnuematic_1.pump(True)
# Turn air pump off.
pnuematic_1.pump(False)
status()#
The status()
method returns the raw status for the pneumatic device.
Devuelve: El estado sin procesar del dispositivo neumático como un entero.
installed()#
The installed()
method checks for device connection.
Returns: True
if the device is connected. False
if it is not.
timestamp()#
The timestamp()
method returns the timestamp of the last received status packet from the Pneumatic System.
Devuelve: La marca de tiempo del último paquete de estado recibido en milisegundos.