Pneumatic#

Introduction#

The VEX IQ Brain can control the VEX IQ Pneumatic system using methods from the Pneumatic class. These methods allow the Brain to control the pneumatic pump and extend or retract pneumatic cylinders.

This page uses pneumatic_1 as the example Pneumatic name. Replace it with your own configured name as needed.

Below is a list of all methods:

Actions — Control pneumatic cylinders.

Mutators — Turn the pneumatic pump on or off.

  • pump_on — Turns the pneumatic pump on.

  • pump_off — Turns the pneumatic pump off.

  • pump — Turns the pneumatic pump on or off.

Getters — Check if the solenoid is connected.

  • installed — Returns whether or not a solenoid is connected to the Brain.

Constructors — Manually initialize and configure Pneumatics.

Actions#

extend#

extend extends a pneumatic cylinder.

Usage:
pneumatic_1.extend(cylinder)

Parameters

Description

cylinder

The cylinder to extend:

  • CYLINDER1
  • CYLINDER2
  • CYLINDERALL – Both cylinders

retract#

retract retracts a pneumatic cylinder.

Usage:
pneumatic_1.retract(cylinder)

Parameters

Description

cylinder

The cylinder to retract:

  • CYLINDER1
  • CYLINDER2
  • CYLINDERALL – Both cylinders

Mutators#

pump_on#

pump_on turns the pneumatic pump on.

Usage:
pneumatic_1.pump_on()

Parameters

Description

This method has no parameters.

pump_off#

pump_off turns the pneumatic pump off.

Usage:
pneumatic_1.pump_off()

Parameters

Description

This method has no parameters.

pump#

pump turns the pneumatic pump on or off.

Usage:
pneumatic_1.pump(state)

Parameters

Description

state

The state to set: True turns the pneumatic pump on, and False turns the pneumatic pump off.

Getters#

installed#

installed returns a Boolean indicating whether the solenoid is connected to the Brain.

  • True — The solenoid is connected to the Brain.

  • False — The solenoid is not connected to the Brain.

Usage:
pneumatic_1.installed()

Parameters

Description

This method has no parameters.

Constructors#

Constructors are used to manually create Pneumatic objects, which are necessary for configuring Pneumatics outside of VEXcode.

Pneumatics#

The Pneumatic constructor creates a Pneumatic object in the specified Smart Port.

Usage:
pneumatic_1 = Pneumatic(smartport)

Parameter

Description

smartport

The Smart Port that the solenoid is connected to, written as PORTx where x is the number of the port.

# Create a Pneumatic object in Port 1
pneumatic_1 = Pneumatic(Ports.PORT1)