PROS EZ Template Controller Auton Selection

While at matches my team has found that often times removing the brain cover in order to select our autonomous code can become a hassle with the wire placement we use. For this reason I have made an attempt to allow us to use our controller in order to select the auton. After this I have come up with

/**
 * Runs while the robot is in the disabled state of Field Management System or
 * the VEX Competition Switch, following either autonomous or opcontrol. When
 * the robot is enabled, this task will exit.
 */
void disabled() {
  if(master.get_digital_new_press(pros::E_CONTROLLER_DIGITAL_LEFT)) {
    ez::as::page_down();
  } else if(master.get_digital_new_press(pros::E_CONTROLLER_DIGITAL_RIGHT)) {
    ez:;as::page_up();
  }
}

We did this by finding the functions meant for limit switches to select the auton. Our next step is to find the code to print the auton information, but we wanted to check if someone can see a problem with what I have written. Any information is helpful, so thank you.

I’m not familiar enough with the disabled function, but you may need to have this inside a while loop to keep looking for a button press, and the button press sets a variable that selects the right auton.

@adrienschlag posted their auton select (in Blocks format) a few weeks back, but you could reference the logic flow in that file and reproduce it in C/C++.

This has been changed to
/**

  • Runs after initialize(), and before autonomous when connected to the Field
  • Management System or the VEX Competition Switch. This is intended for
  • competition-specific initialization routines, such as an autonomous selector
  • on the LCD.
  • This task will exit when the robot is enabled and autonomous or opcontrol
  • starts.
    */
    void competition_initialize() {
    if(master.get_digital_new_press(pros::E_CONTROLLER_DIGITAL_LEFT)) {
    ez::as::page_down();
    } else if(master.get_digital_new_press(pros::E_CONTROLLER_DIGITAL_RIGHT)) {
    ez:;as::page_up();
    }

}
As this placement seemed more appropriate. But input is still needed.