Enum Class ProximityPeriod

java.lang.Object
java.lang.Enum<ProximityPeriod>
com.reduxrobotics.sensors.canandcolor.ProximityPeriod
All Implemented Interfaces:
Serializable, Comparable<ProximityPeriod>, Constable

public enum ProximityPeriod extends Enum<ProximityPeriod>
Enum representing the integration period of the Canandcolor's proximity sensor IC.

This determines how long the proximity sensor spends collecting reflected IR light to determine a proximity reading, which also determines the sample rate. Longer integration periods increase sensitivity but shorter integration periods have faster sample rates.

  • Enum Constant Details

    • k5ms

      public static final ProximityPeriod k5ms
      5 millisecond update period.
    • k10ms

      public static final ProximityPeriod k10ms
      10 millisecond update period.
    • k20ms

      public static final ProximityPeriod k20ms
      20 millisecond update period.
    • k40ms

      public static final ProximityPeriod k40ms
      40 millisecond update period.
  • Method Details

    • values

      public static ProximityPeriod[] 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 ProximityPeriod 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 ProximityPeriod fromIndex(int idx)
      Returns a corresponding enum from the index.
      Parameters:
      idx - the index to fetch.
      Returns:
      a valid enum. If the index value is invalid it will return the default.
    • getIndex

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