diff --git a/include/EZ-Template/drive/drive.hpp b/include/EZ-Template/drive/drive.hpp index d413b53..7b4ecb2 100644 --- a/include/EZ-Template/drive/drive.hpp +++ b/include/EZ-Template/drive/drive.hpp @@ -1253,8 +1253,16 @@ class Drive { * sets the button to lower PID tuner * \param increase * sets the button to increase PID tuner + * \param pageLeft + sets the PID screen left + * \param pageRight + sets the PID screen right + * \param pageUP + switched between kp, ki, kd, and start i + * \param pageDown + switched between kp, ki, kd, and start i */ - void pid_tuner_button_set(pros::controller_digital_e_t decrease, pros::controller_digital_e_t increase); + void pid_tuner_button_set(pros::controller_digital_e_t decrease, pros::controller_digital_e_t increase, pros::controller_digital_e_t pageLeft, pros::controller_digital_e_t pageRight, pros::controller_digital_e_t pageUp, pros::controller_digital_e_t pageDown); ///// // @@ -3554,6 +3562,10 @@ class Drive { pros::controller_digital_e_t pid_tuner_increase; //is this place good? pros::controller_digital_e_t pid_tuner_decrease; + pros::controller_digital_e_t pid_tuner_pageLeft; + pros::controller_digital_e_t pid_tuner_pageRight; + pros::controller_digital_e_t pid_tuner_pageUp; + pros::controller_digital_e_t pid_tuner_pageDown; /** * Private wait until for drive diff --git a/src/EZ-Template/drive/pid_tuner.cpp b/src/EZ-Template/drive/pid_tuner.cpp index 0f179c8..8975296 100644 --- a/src/EZ-Template/drive/pid_tuner.cpp +++ b/src/EZ-Template/drive/pid_tuner.cpp @@ -166,11 +166,21 @@ double Drive::pid_tuner_increment_start_i_get() { return start_i_increment; } /*pros::controller_digital_e_t pid_tuner_increase; pros::controller_digital_e_t pid_tuner_decrease;*/ -void Drive::pid_tuner_button_set(pros::controller_digital_e_t decrease, pros::controller_digital_e_t increase) { +/*void Drive::pid_tuner_button_set(pros::controller_digital_e_t decrease, pros::controller_digital_e_t increase) { pid_tuner_increase = increase; pid_tuner_decrease = decrease; +}*/ + +void Drive::pid_tuner_button_set(pros::controller_digital_e_t decrease, pros::controller_digital_e_t increase, pros::controller_digital_e_t pageLeft, pros::controller_digital_e_t pageRight, pros::controller_digital_e_t pageUp, pros::controller_digital_e_t pageDown){ + pid_tuner_increase = increase; + pid_tuner_decrease = decrease; + pid_tuner_pageLeft = pageLeft; + pid_tuner_pageRight = pageRight; + pid_tuner_pageUp = pageUp; + pid_tuner_pageDown = pageDown; } + // Iterate void Drive::pid_tuner_iterate() { if (!pid_tuner_on) return; // Exit if it's disabled @@ -183,12 +193,12 @@ void Drive::pid_tuner_iterate() { } // Up / Down for Rows - if (master.get_digital_new_press(pros::E_CONTROLLER_DIGITAL_RIGHT)) { + if (master.get_digital_new_press(pid_tuner_pageRight)) { column++; if (column > used_pid_tuner_pids->size() - 1) column = 0; pid_tuner_print(); - } else if (master.get_digital_new_press(pros::E_CONTROLLER_DIGITAL_LEFT)) { + } else if (master.get_digital_new_press(pid_tuner_pageLeft)) { column--; if (column < 0) column = used_pid_tuner_pids->size() - 1; @@ -196,12 +206,12 @@ void Drive::pid_tuner_iterate() { } // Left / Right for Columns - if (master.get_digital_new_press(pros::E_CONTROLLER_DIGITAL_DOWN)) { + if (master.get_digital_new_press(pid_tuner_pageDown)) { row++; if (row > 3) row = 0; pid_tuner_print(); - } else if (master.get_digital_new_press(pros::E_CONTROLLER_DIGITAL_UP)) { + } else if (master.get_digital_new_press(pid_tuner_pageUp)) { row--; if (row < 0) row = 3; diff --git a/src/main.cpp b/src/main.cpp index 78335c7..5c91c00 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -44,7 +44,7 @@ void initialize() { // - ignore this if you aren't using a vertical tracker // chassis.odom_tracker_left_set(&vert_tracker); - chassis.pid_tuner_button_set(pros::E_CONTROLLER_DIGITAL_Y, pros::E_CONTROLLER_DIGITAL_A); // Sets the buttons used for PID Tuning. + chassis.pid_tuner_button_set(pros::E_CONTROLLER_DIGITAL_Y, pros::E_CONTROLLER_DIGITAL_A, pros::E_CONTROLLER_DIGITAL_LEFT, pros::E_CONTROLLER_DIGITAL_RIGHT, pros::E_CONTROLLER_DIGITAL_UP, pros::E_CONTROLLER_DIGITAL_DOWN); // Sets the buttons used for PID Tuning. // Configure your chassis controls chassis.opcontrol_curve_buttons_toggle(true); // Enables modifying the controller curve with buttons on the joysticks