气动#
Introduction#
The VEX EXP Brain can control the CTE Pneumatic Solenoid in order to power the pneumatic pump and extend or retract pneumatic cylinders.
For the examples below, the configured CTE 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.
Below is a list of all available methods:
Actions – Control pneumatic cylinders and the air pump.
extend– Extends a specified pneumatic cylinder in a pneumatic system.retract– Retracts a specified pneumatic cylinder in a pneumatic system.pump_on– Turns the pneumatic pump on for a specified pneumatic system.pump_off– Turns the pneumatic pump off for a specified pneumatic system.
Setters – Turn a pneumatic pump on or off.
pump– Turns the pneumatic pump on or off for a specified pneumatic system.
Constructors – Manually initialize and configure the CTE Pneumatic Solenoid.
Pneumatic– Create a CTE Pneumatic Solenoid.
Actions#
extend#
extend extends a specified pneumatic cylinder in a pneumatic system.
Usage:
extend(value)
范围 |
描述 |
|---|---|
value |
The cylinder to extend:
|
# Extend the first cylinder
pneumatic_1.extend(CYLINDER1)
# Wait 2 seconds
wait(2, SECONDS)
# Retract the first cylinder
pneumatic_1.retract(CYLINDER1)
retract#
retract retracts a specified pneumatic cylinder in a pneumatic system.
Usage:
retract(value)
范围 |
描述 |
|---|---|
value |
The cylinder to retract:
|
# Extend the first cylinder
pneumatic_1.extend(CYLINDER1)
# Wait 2 seconds
wait(2, SECONDS)
# Retract the first cylinder
pneumatic_1.retract(CYLINDER1)
pump_on#
pump_on turns the pneumatic pump on for a specified pneumatic system.
Usage:
pump_on()
# Turn air pump on
pneumatic_1.pump_on()
pump_off#
pump_off turns the pneumatic pump off for a specified pneumatic system.
Usage:
pump_off()
# Turn air pump off
pneumatic_1.pump_off()
Setters#
pump#
pump turns the pneumatic pump on or off for a specified pneumatic system.
Usage:
pump(state)
范围 |
描述 |
|---|---|
state |
|
# Turn air pump on
pneumatic_1.pump(True)
# Turn air pump off
pneumatic_1.pump(False)
Constructors#
Pneumatic#
Pneumatic creates a Pneumatic System.
Pneumatic(smartport)
范围 |
描述 |
|---|---|
|
The Smart Port that the Pneumatic Solenoid is connected to, written as |
# Construct a Pneumatic System "pneumatic_1" with the
# Pneumatic class
pneumatic_1 = Pneumatic(Ports.PORT1)