Memory Permission Error 038018FC

Hello!
I’ve been having one hell of an issue, I’ve shown everyone I can and they can’t find anything wrong with this code. It’s just a test project so I didn’t put it in competition format, plus having main in an infinite loop worked fine up until I started trying to add the vision sensor into the mix, now the code won’t work when it’s the original. I’ve tried simplifying it and it just doesn’t want to budge, I’ve tried deleting the build folder, creating a new project and moving them over, updating the brain, and rebooting the application.

What seems to be the issue?

// Global Variables
motor_group Flywheel = motor_group(Fly1, Fly2, Fly3);
pneumatics Piston1 = pneumatics(Brain.ThreeWirePort.A);
pneumatics Piston2 = pneumatics(Brain.ThreeWirePort.B);

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

  // Main Method
  while (1) {
    // Pneumatic Controls
    if (Controller1.ButtonA.pressing()) {
      Piston1.open();
      Piston2.open();
    }
    else if (Controller1.ButtonX.pressing()) {
      for (int Counter = 0; Counter <= 4; Counter++) {
        Piston1.open();
        Piston2.open();
        wait(100, msec);
        Piston1.close();
        Piston2.close();
        wait(500, msec);
      }
    }
    else if (Controller1.ButtonL2.pressing()) {
      Piston1.open();
    } else if (Controller1.ButtonR2.pressing()) {
      Piston2.open();
    } else {
      Piston1.close();
      Piston2.close();
    }

    // Flywheel Controls
    if (Controller1.ButtonUp.pressing()) {
      Flywheel.spin(forward, 100, pct);
    }
    else if (Controller1.ButtonDown.pressing()) {
      Flywheel.spin(forward, 10, pct);
    }

    // Emergency Shut-off
    if (Controller1.ButtonB.pressing()) {
      Flywheel.stop(coast);
    }

    // Prevents wasted resources
    wait(20, msec);
  }
}
1 Like

No clue why but this happened to me too, just starts commenting out lines to find where the problem is and then just implement that line a different way.

1 Like

I found the solution to be placing the pneumatic constructors in robot-config.cpp with expert robot configuration turned on, something about brain not being defined in main for some reason and therefore cannot point to the three wire port.