Enum Class Canandcolor.ColorPeriod

All Implemented Interfaces:
Serializable, Comparable<Canandcolor.ColorPeriod>, Constable
Enclosing class:

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.
      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.)
      name - the name of the enum constant to be returned.
      the enum constant with the specified name
      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.
      idx - the index to fetch.
      a valid color config. Always guarenteed to return one.
    • getIndex

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