Vex Pneumatics Coding Issue

We recently attached pneumatics to our robot. When we had pressurized the air reservoir, we tested the pneumatic cylinder manually (by pressing the button on the solanoid) and it extended correctly. I then connected it to the brain and tried to test it with code. At first, it didn’t work (and I assumed the 3-wire port was broken, so I switched ports from A to B) but it continued to not extend. Any ideas on what to do? Thanks!

P.S. here is the code I’m using. It’s just a basic program to see if the cylinder will even extend.

/*----------------------------------------------------------------------------*/
/*                                                                            */
/*    Module:       main.cpp                                                  */
/*    Author:       celesteroselli                                            */
/*    Created:      Tue Oct 18 2022                                           */
/*    Description:  V5 project                                                */
/*                                                                            */
/*----------------------------------------------------------------------------*/

// ---- START VEXCODE CONFIGURED DEVICES ----
// Robot Configuration:
// [Name]               [Type]        [Port(s)]
// Pneumatics           digital_out   B               
// ---- END VEXCODE CONFIGURED DEVICES ----

#include "vex.h"

using namespace vex;

int main() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();

  Pneumatics.set(true);
  wait(2, sec);
  Pneumatics.set(false);

  
  
}

I already configured it as a 3-wire digital out. You can see it recognizes it too at the top in configured devices. Do I have to do anything else?

// ---- START VEXCODE CONFIGURED DEVICES ----
// Robot Configuration:
// [Name]               [Type]        [Port(s)]
// Pneumatics           digital_out   B               
// ---- END VEXCODE CONFIGURED DEVICES ----

Can you activate the cylinder in the devices menu on the brain?

1 Like

Also, make sure the wire is in the correct orientation and inserted all the way into the 3-wire port.

If you configured it manually, you also have to extern it in the other config file.

Turns out we had a faulty solenoid!

1 Like