Enum Class Canandcolor.ColorPeriod

java.lang.Object
java.lang.Enum<Canandcolor.ColorPeriod>
com.reduxrobotics.sensors.canandcolor.Canandcolor.ColorPeriod
All Implemented Interfaces:
Serializable, Comparable<Canandcolor.ColorPeriod>, Constable
Enclosing class:
Canandcolor

public static enum Canandcolor.ColorPeriod extends Enum<Canandcolor.ColorPeriod>
Enum representing the internal configuration of the Canandcolor's color IC. Passed to Canandcolor.Settings which may be then used with Canandcolor.setSettings(com.reduxrobotics.sensors.canandcolor.Canandcolor.Settings, double, int) to configure the device.

The color sensor IC supports a single parameter that serves as both the integration and sampling period, which can be adjusted from 40 ms to 1280 ms. This period functions as a kind of "exposure time" -- longer periods mean colors at lower light can be read more accurately, but also mean they saturate faster in higher light conditions and have higher latency.

The default is 40 ms.
  • Enum Constant Details

  • Method Details

    • values

      public static Canandcolor.ColorPeriod[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Canandcolor.ColorPeriod valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • fromIndex

      public static Canandcolor.ColorPeriod fromIndex(int idx)
      Returns a corresponding color config from the index.
      Parameters:
      idx - the index to fetch.
      Returns:
      a valid color config. Always guarenteed to return one.
    • getIndex

      public int getIndex()
      Gets the corresponding index for the value in question.
      Returns:
      the index value for the enum (used internally)