Skip to content

Commit

Permalink
Sunday
Browse files Browse the repository at this point in the history
  • Loading branch information
Se-gol committed Sep 12, 2021
1 parent d3c4a65 commit de04d8a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
22 changes: 13 additions & 9 deletions src/main/java/frc/robot/subsystems/colorwheel/ColorWheel.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ public class ColorWheel extends SubsystemBase {

private String lastColor = "";

public String whatColor() {
Color color = sensor.getColor();
public ColorWheel() {
match.addColorMatch(Color.kYellow); // yellow
match.addColorMatch(Color.kGreen); // green
match.addColorMatch(Color.kRed); // red
match.addColorMatch(Color.kBlue); // blue
}

public String whatColor() {
Color color = sensor.getColor();
ColorMatchResult result = match.matchClosestColor(color);
Color resultColor = result.color;

Expand All @@ -35,13 +38,14 @@ public String whatColor() {
return "blue";
}
}
public String rotationColor () {
return "";
}

public void setPower (double powerMotor){
motor.set(ControlMode.PercentOutput, powerMotor);
}

public String rotationColor() {
return "";
}

public void setPower(double powerMotor) {
motor.set(ControlMode.PercentOutput, powerMotor);
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public RotationControl(ColorWheel colorWheel) {
public void initialize() {
startingColor = colorWheel.whatColor();
lastColor = colorWheel.whatColor();
currentColor = colorWheel.whatColor();

}

Expand Down Expand Up @@ -49,6 +48,6 @@ public boolean isFinished() {

@Override
public void end(boolean interrupted) {
colorWheel.setpower(0);
colorWheel.setPower(0);
}
}

0 comments on commit de04d8a

Please sign in to comment.