Pneumatic#
Pneumatic commands will only work with the CTE Pneumatic parts.
Initializing the Pneumatic Class#
A Pneumatic System is created by using the following constructor:
Pneumatic(port)
This constructor use one parameter:
Parameter |
Description |
---|---|
|
A valid Smart Port that the Pneumatic Solenoid is connected to. |
# 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.
Class Methods#
extend()#
The extend(value)
method extends a cylinder.
Parameters |
Description |
---|---|
value |
A valid CylinderType. |
Returns: None.
# 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.
Parameters |
Description |
---|---|
value |
A valid CylinderType. |
Returns: None.
# 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.
Returns: None.
# Turn air pump on.
pnuematic_1.pump_on()
pump_off()#
The pump_off()
method turns the pneumatic air pump off.
Returns: None.
# Turn air pump off.
pnuematic_1.pump_off()
pump()#
The pump(state)
method turns the pneumatic air pump on or off.
Parameters |
Description |
---|---|
state |
The compressor state. |
Returns: None.
# 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.
Returns: The raw status of the pneumatic device as an integer.
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.
Returns: The timestamp of the last received status packet in milliseconds.