Pneumatics#
Introduction#
The VEX V5 Brain can control a V5 Pneumatics system using the pneumatics class. This class allows the Brain to open or close the system, extending or retracting pneumatic cylinders.
The Pneumatics device must be manually constructed in code and cannot be added using the Device Menu in VEXcode V5.
Class Constructors#
pneumatics(
triport::port &port );
Class Destructor#
Destroys the pneumatics object and releases associated resources.
~pneumatics();
Parameters#
Parameter |
Type |
Description |
|---|---|---|
|
|
The 3-Wire Port the Pneumatic Solenoid is connected to, written as |
Notes#
This class can only be constructed manually in code, as it cannot be constructed using the Device Menu in VEXcode V5.
A Brain or 3-Wire Expander must be created first before they can be used to create an object with the
pneumaticsclass constructor.
Example#
// Create the pneumatics instance on 3-Wire Port A
pneumatics PneumaticsA = pneumatics(Brain.ThreeWirePort.A);
Member Functions#
The pneumatics class includes the following member functions:
open— Sets the Pneumatic Solenoid to the open state, allowing air to flow into the cylinder.close— Sets the Pneumatic Solenoid to the close state, stopping air from flowing into the cylinder.
Before calling any pneumatics member functions, a pneumatics instance must be created, as shown below:
/* This constructor is required to use a
V5 Pneumatics Solenoid when not configured as
a Digital Out device. Replace the values
as needed. */
// Create the pneumatics instance on 3-Wire Port A
pneumatics PneumaticsA = pneumatics(Brain.ThreeWirePort.A);
open#
Sets the Pneumatic Solenoid to the open state, allowing air to flow into the cylinder.
Available Functionsvoid open();
This function does not take any parameters.
Return ValuesThis function does not return a value.
Examples// Open the solenoid to extend the cylinder
PneumaticsA.open();
close#
Sets the Pneumatic Solenoid to the close state, stopping air from flowing into the cylinder.
Available Functionsvoid close();
This function does not take any parameters.
Return ValuesThis function does not return a value.
Examples// Close the solenoid to retract the cylinder
PneumaticsA.close();