Compare commits

..
2 Commits
Author SHA1 Message Date
Carter Essen ecebf87643 Merge branch 'main' of http://192.168.162.99:3000/carter/VEX-OverRide 2026-11-22 20:11:02 -05:00
Carter Essen d9db3ee688 IDK 2026-11-22 20:07:03 -05:00
2 changed files with 36 additions and 43 deletions

No files matched your search

@@ -66,6 +66,27 @@ void LiftMech::lift_driver_control(ControllerR currController, ButtonsR buttonUs
}
}
void LiftMech::lift_auton_control(int pickState) {
switch (pickState)
{
case 1:
liftTarget = liftStates[0];
break;
case 2:
liftTarget = liftStates[1];
break;
case 3:
liftTarget = liftStates[2];
break;
case 4:
liftTarget = liftStates[3];
break;
default:
liftTarget = liftStates[0];
break;
}
}
void LiftMech::cycle_states() {
currLiftState ++;
@@ -162,39 +183,39 @@ void LiftMech::lift_driver_control(ControllerR currController, ButtonsR buttonUs
break;
}
break;
case ControllerR::slave:
case ControllerR::master:
switch (buttonUsed)
{
case ButtonsR::arrow_buttons:
if (slave.get_digital(DIGITAL_RIGHT)) {
if (master.get_digital(DIGITAL_RIGHT)) {
cycle_states();
}
else if (slave.get_digital(DIGITAL_DOWN)) {
else if (master.get_digital(DIGITAL_DOWN)) {
reset_state();
}
break;
case ButtonsR::Y_B_buttons:
if (slave.get_digital(DIGITAL_Y)) {
if (master.get_digital(DIGITAL_Y)) {
cycle_states();
}
else if (slave.get_digital(DIGITAL_B)) {
else if (master.get_digital(DIGITAL_B)) {
reset_state();
}
break;
case ButtonsR::left_shoulder_buttons:
if (slave.get_digital(DIGITAL_L1)) {
if (master.get_digital(DIGITAL_L1)) {
cycle_states();
}
else if (slave.get_digital(DIGITAL_L2)) {
else if (master.get_digital(DIGITAL_L2)) {
reset_state();
}
break;
case ButtonsR::right_shoulder_buttons:
if (slave.get_digital(DIGITAL_R1)) {
if (master.get_digital(DIGITAL_R1)) {
cycle_states();
}
else if (slave.get_digital(DIGITAL_R2)) {
else if (master.get_digital(DIGITAL_R2)) {
reset_state();
}
break;
+6 -34
View File
@@ -25,7 +25,7 @@ Mechanisms motorControl;
//ArmMech armObj;
/**
* This is creating and initializing and instance of the Optical sensors structure
* Creates and initializes and instance of the Optical sensors structure
*
* Finds the memory location of the two color sensors, which then the "mySensors" container
* gives to the pointers. So now the pointers have somewhere to point to in memory.
@@ -41,7 +41,11 @@ namespace ez {
// Lift constructor
LiftMech liftObj(
<<<<<<< HEAD
{0, 0, 0, 0}, 4);
=======
{0, -19714, -13017, -27993, -17491, -48393, -37459, -69706, -58957, -89693, -79453, -106664, -99115}, 13);
>>>>>>> 4be5e2958fb4be3d35cbe58b8933bfde5ce90ed3
// Wrist constructor
/*WristMech wristObj(
@@ -321,38 +325,6 @@ void opcontrol() {
MotorGroups::roller_M, 127, 0);
// Basic control scheme
/*arm.set_brake_mode(MOTOR_BRAKE_HOLD);
if (master.get_digital(DIGITAL_L1)) {
arm.move(90);
}
else if (master.get_digital(DIGITAL_L2)) {
arm.move(-90);
}
else {
arm.brake();
}
lift.set_brake_mode(MOTOR_BRAKE_HOLD);
if (master.get_digital(DIGITAL_R1)) {
lift.move(127);
}
else if (master.get_digital(DIGITAL_R2)) {
lift.move(-127);
}
else {
lift.brake();
}
wrist.set_brake_mode(MOTOR_BRAKE_HOLD);
if (master.get_digital(DIGITAL_A)) {
wrist.move(20);
}
else if (master.get_digital(DIGITAL_B)) {
wrist.move(-20);
}
else {
wrist.brake();
}*/
//armObj.arm_driver_control(ControllerR::master, ButtonsR::left_shoulder_buttons);
liftObj.lift_driver_control(ControllerR::master, ButtonsR::right_shoulder_buttons);
@@ -373,7 +345,7 @@ void opcontrol() {
//std::cout << "Wrist rotation sensor value: " << "\033[33m" << wristRotation.get_position() << " cdg" << "mm\033[0m" << std::endl;
//std::cout << "Arm limit switch value: " << "\033[34m" << armReset.get_value() << "mm\033[0m" << std::endl;*/
///pros::delay(250);
//pros::delay(250);
pros::delay(ez::util::DELAY_TIME); // This is used for timer calculations! Keep this ez::util::DELAY_TIME
}
}