TeamCode/src/main/java/org/firstinspires/ftc/teamcode/DRSS_CaseSwitchBlueAutonomous.java
/**
     * This method uses the data from the color sensor to tell what what color emitted light is.
     * Two units of either red or blue need to be detected by the color sensor to be accurately read
     * as red or blue. This condition will be checked for two seconds before the method stops
     * attempting and goes to the next step. Due to the beacons being very dim, the robot needs to
     * be lined up very precisely near the color beacon for this to be effective.
     */
This method uses the data from the color sensor to tell what what color emitted light is.
Two units of either red or blue need to be detected by the color sensor to be accurately read
as red or blue. This condition will be checked for two seconds before the method stops
attempting and goes to the next step. Due to the beacons being very dim, the robot needs to
be lined up very precisely near the color beacon for this to be effective.
This method uses the data from the color sensor to tell what what color emitted light is . Two units of either red or blue need to be detected by the color sensor to be accurately read as red or blue . This condition will be checked for two seconds before the method stops attempting and goes to the next step . Due to the beacons being very dim the robot needs to be lined up very precisely near the color beacon for this to be effective .
private void detectColor(){
        red = colorSensor.red();
        blue = colorSensor.blue();
        green = colorSensor.green();
        telemetry.addData("Blue value", blue);
        telemetry.addData("Red value", red);
        telemetry.addData("Green value", green);
        telemetry.addData("Current step", currentStep);
        if(blue >= 2){
            telemetry.addData("Blue Achieved", true);
            colorFound = Color.BLUE;
            currentStep++;
            resetRequested = true;
        } else if(red >= 2){
            telemetry.addData("Red Achieved", true);
            colorFound = Color.RED;
            telemetry.addData("runTime", runTime.time());
            currentStep++;
            resetRequested = true;
        } else{
            colorFound = Color.OTHER;
            currentStep++;
            resetRequested = true;
        }
    }
private void detectColor ( ) { red = colorSensor . red ( ) ; blue = colorSensor . blue ( ) ; green = colorSensor . green ( ) ; telemetry . addData ( "Blue value" , blue ) ; telemetry . addData ( "Red value" , red ) ; telemetry . addData ( "Green value" , green ) ; telemetry . addData ( "Current step" , currentStep ) ; if ( blue >= 2 ) { telemetry . addData ( "Blue Achieved" , true ) ; colorFound = Color . BLUE ; currentStep ++ ; resetRequested = true ; } else if ( red >= 2 ) { telemetry . addData ( "Red Achieved" , true ) ; colorFound = Color . RED ; telemetry . addData ( "runTime" , runTime . time ( ) ) ; currentStep ++ ; resetRequested = true ; } else { colorFound = Color . OTHER ; currentStep ++ ; resetRequested = true ; } }
This method uses the data from the color sensor to tell what what color emitted light is.
This method uses the data from the color sensor to tell what what color emitted light is .
//Declare variables to hold the red, blue, and green values found by the color sensor //Send data to the robot controller