How to configure pneumatics in VEXcode Pro V5


Can anyone provide example code for configuring pneumatics? I’ve tried everything I can find online, but I still end up with a memory permission error each time.


Pneumatics are configured as “digital out” devices:

“Memory permission error” strikes me as an unusual kind of error to get in this scenario – what are you doing to configure the pneumatics right now?


This is how I have it configured now.

digital_out dig1 = digital_out(Brain.ThreeWirePort.H);

That line looks OK – could you share the complete contents of your main.cpp? Maybe the problem is somewhere else.

Please include triple backtics (```) before and after your code, on their own line, for formatting.

1 Like

We have a separate file for testing pneumatics right now because I wanted to make sure that the problem was actually caused by the pneumatics. This is the whole thing right now.

#include "vex.h"

using namespace vex;

digital_out dig1 = digital_out(Brain.ThreeWirePort.H);

vex::controller master(vex::controllerType::primary);

int main() {
    while (1) {
        if (master.ButtonL1.pressing()) {
        } else {

Just to check – are you sure the solenoid is actually connected to port H?

You are probably using Brain.ThreeWirePort.H before it’s been instantiated, all depends on the name of the file, there’s no guarantee for order of constructors across files. There’s one way to deal with that here.


Hi, I added this line of code above where I configured dig1, but I am still getting an error.

triport ThreeWirePort = vex::triport( vex::PORT22 );
digital_out dig1 = digital_out(Brain.ThreeWirePort.A);

We got it!!! Thanks for your help everyone.

1 Like