3 - Sensors/Actuators
Pneumatics
In a typical pneumatic configuration, you'll have a solenoid connected to the brain using the ADI (3-wire) ports. The solenoid actuates a pneumatic piston by controlling the flow of air to/from the piston.
For more detailed information on pneumatics, check out VEX's knowledge base articles on pneumatics.

You can control a pneumatic solenoid (and, by extension, the piston) by making an ADIPneumatic.
// Define a pneumatic
ADIPneumatic samplePneumatic = ADIPneumatic(
"SamplePneumatic", // <-- Name of the pneumatic (for logging purposes)
'B', // <-- ADI port the pneumatic is connected to (A, B, C, D, E, F, G, H)
false // <-- Optional: Whether or not the solenoid is reversed (defaults to false)
);
void opcontrol() override {
samplePneumatic.extend();
samplePneumatic.retract();
samplePneumatic.setExtended(true);
samplePneumatic.setExtended(false);
// ...
}
Pneumatic Group
If you have multiple solenoids you want to control together, you can make an ADIPneumaticGroup to control them all at once.
ADIPneumaticGroup samplePneumaticGroup = ADIPneumaticGroup(
"SamplePneumaticGroup", // <-- Name of the pneumatic group (for logging purposes)
{'A', 'B', 'C'} // <-- List the ADI ports of each pneumatic in the group
);
void opcontrol() override {
samplePneumatic.extend();
samplePneumatic.retract();
// ...
}