CTE Pneumatics#
Introduction#
CTE Pneumatic commands will only work with the CTE Pneumatic parts. You will need to manually import the CTE module in order for this to work:
from cte import *
The CTE Pneumatic system uses an air pump and solenoid to control compressed air for moving cylinders. It can turn the pump on or off and extend or retract cylinders through code.
This page uses cte_pneumatic as the example CTE Pneumatics name. Replace it with your own configured name as needed.
Below is a list of available methods:
extend– Extend a cylinder.retract– Retract a cylinder.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.installed– Returns whether or not a CTE Pneumatic Solenoid is connected to the Brain.
Constructors – Manually initialize and configure a CTE Pneumatics Solenoid.
Pneumatic– Creates a CTE Pneumatic Solenoid.
extend#
extend extends a cylinder.
Usage:
cte_pneumatic.extend(cylinder)
Parameters |
Description |
|---|---|
|
The cylinder to extend:
|
retract#
retract retracts a cylinder.
Usage:
cte_pneumatic.retract(cylinder)
Parameters |
Description |
|---|---|
|
The cylinder to retract:
|
pump_on#
pump_on turns the air pump on.
Usage:
cte_pneumatic.pump_on()
Parameters |
Description |
|---|---|
This method has no parameters. |
pump_off#
pump_off turns the air pump off.
Usage:
cte_pneumatic.pump_off()
Parameters |
Description |
|---|---|
This method has no parameters. |
pump#
pump turns the air pump on or off.
Usage:
cte_pneumatic.pump(state)
Parameters |
Description |
|---|---|
|
The air pump state:
|
installed#
installed returns a Boolean indicating whether the CTE Pneumatic Solenoid is connected to the Brain.
True- The solenoid is connected to the Brain.False- The solenoid is not connected to the Brain.
Usage:
cte_pneumatic.installed()
Parameters |
Description |
|---|---|
This method has no parameters. |
Constructors#
Constructors are used to manually create Pneumatic objects, which are necessary for configuring a CTE Pneumatic Solenoid.
Pneumatic#
Pneumatic creates a CTE Pneumatic Solenoid.
Usage:
Pneumatic(smartport)
Parameter |
Description |
|---|---|
|
The Smart Port that the CTE Pneumatic Solenoid is connected to, written as |
from cte import *
# Create a CTE Pneumatic Solenoid in Port 1
cte_pneumatic = Pneumatic(Ports.PORT1)