Package frclib.sensor

Class FrcRevColorSensorV3

java.lang.Object
com.revrobotics.ColorSensorV3
frclib.sensor.FrcRevColorSensorV3

public class FrcRevColorSensorV3 extends com.revrobotics.ColorSensorV3
This class implements the platform dependent Rev Color Sensor V3. It is a wrapper class extending the ColorSensorV3 class.
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.revrobotics.ColorSensorV3

    com.revrobotics.ColorSensorV3.ColorSensorMeasurementRate, com.revrobotics.ColorSensorV3.ColorSensorResolution, com.revrobotics.ColorSensorV3.GainFactor, com.revrobotics.ColorSensorV3.LEDCurrent, com.revrobotics.ColorSensorV3.LEDPulseFrequency, com.revrobotics.ColorSensorV3.MainControl, com.revrobotics.ColorSensorV3.ProximitySensorMeasurementRate, com.revrobotics.ColorSensorV3.ProximitySensorResolution, com.revrobotics.ColorSensorV3.RawColor, com.revrobotics.ColorSensorV3.Register
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor: Create an instance of the object.
    FrcRevColorSensorV3(String instanceName, edu.wpi.first.wpilibj.I2C.Port i2cPort)
    Constructor: Create an instance of the object.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addColorMatch(edu.wpi.first.wpilibj.util.Color color)
    This method adds a color to the set the color matcher will match.
    int
    This method returns the Blue value read from the sensor.
    edu.wpi.first.wpilibj.util.Color
    This method returns the color read from the sensor.
    int
    This method returns the Green value read from the sensor.
    int
    This method returns the IR value read from the sensor.
    edu.wpi.first.wpilibj.util.Color
    This method returns the closest color matched in the color matcher set.
    double
    This methoe returns the confidence level of the matched color.
    int
    This method returns the proximity value read from the sensor.
    int
    This method returns the Red value read from the sensor.
    This method returns the instance name.

    Methods inherited from class com.revrobotics.ColorSensorV3

    configureColorSensor, configureProximitySensor, configureProximitySensorLED, getCIEColor, getRawColor, hasReset, isConnected

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • FrcRevColorSensorV3

      public FrcRevColorSensorV3(String instanceName, edu.wpi.first.wpilibj.I2C.Port i2cPort)
      Constructor: Create an instance of the object.
      Parameters:
      instanceName - specifies the instance name.
      i2cPort - specifies the I2C port the sensor is connected to.
    • FrcRevColorSensorV3

      public FrcRevColorSensorV3(String instanceName)
      Constructor: Create an instance of the object.
      Parameters:
      instanceName - specifies the instance name.
  • Method Details

    • toString

      public String toString()
      This method returns the instance name.
      Overrides:
      toString in class Object
      Returns:
      instance name.
    • addColorMatch

      public void addColorMatch(edu.wpi.first.wpilibj.util.Color color)
      This method adds a color to the set the color matcher will match.
      Parameters:
      color - specifies the color to be added to the color matcher set.
    • getColor

      public edu.wpi.first.wpilibj.util.Color getColor()
      This method returns the color read from the sensor.
      Overrides:
      getColor in class com.revrobotics.ColorSensorV3
      Returns:
      color read from the sensor.
    • getRed

      public int getRed()
      This method returns the Red value read from the sensor.
      Overrides:
      getRed in class com.revrobotics.ColorSensorV3
      Returns:
      Red value read from the sensor.
    • getGreen

      public int getGreen()
      This method returns the Green value read from the sensor.
      Overrides:
      getGreen in class com.revrobotics.ColorSensorV3
      Returns:
      Green value read from the sensor.
    • getBlue

      public int getBlue()
      This method returns the Blue value read from the sensor.
      Overrides:
      getBlue in class com.revrobotics.ColorSensorV3
      Returns:
      Blue value read from the sensor.
    • getIR

      public int getIR()
      This method returns the IR value read from the sensor.
      Overrides:
      getIR in class com.revrobotics.ColorSensorV3
      Returns:
      IR value read from the sensor.
    • getProximity

      public int getProximity()
      This method returns the proximity value read from the sensor.
      Overrides:
      getProximity in class com.revrobotics.ColorSensorV3
      Returns:
      proximity value read from the sensor.
    • getMatchedColor

      public edu.wpi.first.wpilibj.util.Color getMatchedColor()
      This method returns the closest color matched in the color matcher set.
      Returns:
      matched color.
    • getMatchedConfidence

      public double getMatchedConfidence()
      This methoe returns the confidence level of the matched color.
      Returns:
      match confidence level.