From f2d8702882f1f7f1fe9c2a0d47fe904925b37645 Mon Sep 17 00:00:00 2001 From: Ethan Stacy Date: Thu, 22 Feb 2024 17:49:36 -0700 Subject: [PATCH] Add blank climb motor --- src/main.cpp | 14 ++++++++++++-- src/ports.h | 2 ++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 5383497..2961544 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,6 +19,8 @@ pros::Motor_Group catapult_group(CATAPULT_DRIVE_PORTS); pros::Motor catapult_block(CATAPULT_STOPPER_PORT); +pros::Motor climb_motor(CLIMB_MOTOR_PORT); + enum class CatapultDeployStatus { NotDeploying, RemoveBlock, @@ -137,6 +139,10 @@ void initCommon() pros::motor_encoder_units_e::E_MOTOR_ENCODER_DEGREES); catapult_block.set_brake_mode(pros::E_MOTOR_BRAKE_HOLD); + climb_motor.set_gearing(pros::motor_gearset_e_t::E_MOTOR_GEAR_GREEN); + climb_motor.set_encoder_units( + pros::motor_encoder_units_e::E_MOTOR_ENCODER_DEGREES); + intake_extension_group.move(-50); pros::delay(1000); intake_extension_group.tare_position(); @@ -684,8 +690,7 @@ void opcontrol() catapult_block.brake(); } - bool do_deploy_catapult = - ctrl.get_digital(DIGITAL_DOWN); + bool do_deploy_catapult = ctrl.get_digital(DIGITAL_UP); if (do_deploy_catapult) { if (catapult_button_timer_running == false) { catapult_button_timer->Restart(); @@ -700,6 +705,11 @@ void opcontrol() } } + bool do_deploy_climb = (bool)ctrl.get_digital(DIGITAL_DOWN) && + (bool)ctrl.get_digital(DIGITAL_B); + if (do_deploy_climb) { + } + pros::delay(5); } } diff --git a/src/ports.h b/src/ports.h index 9df0463..95b18fc 100644 --- a/src/ports.h +++ b/src/ports.h @@ -8,3 +8,5 @@ #define CATAPULT_DRIVE_PORTS { -5 , 6 } #define CATAPULT_STOPPER_PORT -13 + +#define CLIMB_MOTOR_PORT 14