Skip to content

Commit

Permalink
colour sort
Browse files Browse the repository at this point in the history
  • Loading branch information
Sir-Encoded committed Jan 28, 2025
1 parent 80593e2 commit 58515fa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions include/deviceGlobals.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ inline pros::Controller controller(pros::E_CONTROLLER_MASTER);

// v1
inline pros::MotorGroup leftDrive({4, -3, -5});
inline pros::MotorGroup rightDrive({7, -10, 8});
inline pros::MotorGroup rightDrive({-7, 10, 8});

// Intake
inline pros::MotorGroup intake({-9, -20});
inline pros::Motor wallStake(21);
inline pros::Motor wallStake(16);

// Pneumatics
inline pros::adi::Pneumatics clampPiston('A', false);
Expand Down
12 changes: 9 additions & 3 deletions src/subsystem/colourSort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,21 @@ void initializeColourSort() {
// eject blue rings
console.println("eject blue impostor");
intakeLock = true;
pros::delay(230);
intake.brake();
pros::delay(600);
pros::delay(168);
intake.move_voltage(12000);
intakeLock = false;
}
if (alliance == "blue" && optical.get_hue() > 15 && optical.get_hue() < 40) {
if (alliance == "blue" && optical.get_hue() > 15 && optical.get_hue() < 27) {
// eject red rings
intake.brake();
console.println("eject red impostor");
intakeLock = true;
pros::delay(230);
intake.brake();
pros::delay(168);
intake.move_voltage(12000);
intakeLock = false;
}

pros::delay(10);
Expand Down
2 changes: 1 addition & 1 deletion src/subsystem/opcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void refreshWallstakes() {
void resetWallstakes() {
if(controller.get_digital_new_press(pros::E_CONTROLLER_DIGITAL_A)) {
pros::Task([] {
while ((wallStakeRotationSensor.get_angle() / 100) < 32) {
while ((wallStakeRotationSensor.get_angle() / 100) < 37.3) {
wallStake.move_voltage(8000);
}
controller.rumble(".");
Expand Down

0 comments on commit 58515fa

Please sign in to comment.