src/main/java/frc/robot/Robot.java
@Override
  public void robotPeriodic() {
  
    MyContourReport = NetworkTableInstance.getDefault().getTable("limelight");
    ty = MyContourReport.getEntry("ty").getDouble(defaultDouble);
    tx = MyContourReport.getEntry("tx").getDouble(defaultDouble);
    ta = MyContourReport.getEntry("ta").getDouble(defaultDouble);
    SmartDashboard.putNumber("ty",ty);
    
    limelightY = ty;
    limelightX = tx;
    limelightArea = ta;
    
    updateInputs();
    updateNetworkEntries();
   


    angleToGoalDegrees = Statics.Limelight_Mount_Angle_Degrees + limelightY;
    angleToGoalRadians = angleToGoalDegrees * (3.14159 / 180.0);


    distanceFromLimelightToGoalInches = (Statics.Goal_Height_Inches - Statics.LimeLight_Height_Inches)/Math.tan(angleToGoalRadians);

    if(climbLED){
      if(DriverStation.getAlliance() == DriverStation.Alliance.Blue && LED.get() != -0.95){
          LED.set(-0.95);
      }
      else if(DriverStation.getAlliance() == DriverStation.Alliance.Red && LED.get() != -0.93){
          LED.set(-0.93);
      }
    }
    else if(scanForBalls() && LED.get() != 0.71){
      LED.set(0.71);
    }
    else if(!scanForBalls() && LED.get() != 0.43){
      LED.set(0.43);
    }
  }
/**
   * This function is called every robot packet, no matter the mode. Use this for items like
   * diagnostics that you want ran during disabled, autonomous, teleoperated and test.
   *
   * <p>This runs after the mode specific periodic functions, but before LiveWindow and
   * SmartDashboard integrated updating.
   */
This function is called every robot packet, no matter the mode. Use this for items like
diagnostics that you want ran during disabled, autonomous, teleoperated and test.

This runs after the mode specific periodic functions, but before LiveWindow and
SmartDashboard integrated updating.
This function is called every robot packet no matter the mode . Use this for items like diagnostics that you want ran during disabled autonomous teleoperated and test . This runs after the mode specific periodic functions but before LiveWindow and SmartDashboard integrated updating .
@Override
  public void robotPeriodic() {
    MyContourReport = NetworkTableInstance.getDefault().getTable("limelight");
    ty = MyContourReport.getEntry("ty").getDouble(defaultDouble);
    tx = MyContourReport.getEntry("tx").getDouble(defaultDouble);
    ta = MyContourReport.getEntry("ta").getDouble(defaultDouble);
    SmartDashboard.putNumber("ty",ty);
    limelightY = ty;
    limelightX = tx;
    limelightArea = ta;
    updateInputs();
    updateNetworkEntries();
    angleToGoalDegrees = Statics.Limelight_Mount_Angle_Degrees + limelightY;
    angleToGoalRadians = angleToGoalDegrees * (3.14159 / 180.0);
    distanceFromLimelightToGoalInches = (Statics.Goal_Height_Inches - Statics.LimeLight_Height_Inches)/Math.tan(angleToGoalRadians);
    if(climbLED){
      if(DriverStation.getAlliance() == DriverStation.Alliance.Blue && LED.get() != -0.95){
          LED.set(-0.95);
      }
      else if(DriverStation.getAlliance() == DriverStation.Alliance.Red && LED.get() != -0.93){
          LED.set(-0.93);
      }
    }
    else if(scanForBalls() && LED.get() != 0.71){
      LED.set(0.71);
    }
    else if(!scanForBalls() && LED.get() != 0.43){
      LED.set(0.43);
    }
  }
@ Override public void robotPeriodic ( ) { MyContourReport = NetworkTableInstance . getDefault ( ) . getTable ( "limelight" ) ; ty = MyContourReport . getEntry ( "ty" ) . getDouble ( defaultDouble ) ; tx = MyContourReport . getEntry ( "tx" ) . getDouble ( defaultDouble ) ; ta = MyContourReport . getEntry ( "ta" ) . getDouble ( defaultDouble ) ; SmartDashboard . putNumber ( "ty" , ty ) ; limelightY = ty ; limelightX = tx ; limelightArea = ta ; updateInputs ( ) ; updateNetworkEntries ( ) ; angleToGoalDegrees = Statics . Limelight_Mount_Angle_Degrees + limelightY ; angleToGoalRadians = angleToGoalDegrees * ( 3.14159 / 180.0 ) ; distanceFromLimelightToGoalInches = ( Statics . Goal_Height_Inches - Statics . LimeLight_Height_Inches ) / Math . tan ( angleToGoalRadians ) ; if ( climbLED ) { if ( DriverStation . getAlliance ( ) == DriverStation . Alliance . Blue && LED . get ( ) != - 0.95 ) { LED . set ( - 0.95 ) ; } else if ( DriverStation . getAlliance ( ) == DriverStation . Alliance . Red && LED . get ( ) != - 0.93 ) { LED . set ( - 0.93 ) ; } } else if ( scanForBalls ( ) && LED . get ( ) != 0.71 ) { LED . set ( 0.71 ) ; } else if ( ! scanForBalls ( ) && LED . get ( ) != 0.43 ) { LED . set ( 0.43 ) ; } }
This function is called every robot packet, no matter the mode.
This function is called every robot packet no matter the mode .