Enum Class CanandcolorProximityConfig.IntegrationPeriod
java.lang.Object
java.lang.Enum<CanandcolorProximityConfig.IntegrationPeriod>
com.reduxrobotics.sensors.canandcolor.CanandcolorProximityConfig.IntegrationPeriod
- All Implemented Interfaces:
Serializable
,Comparable<CanandcolorProximityConfig.IntegrationPeriod>
,Constable
- Enclosing class:
- CanandcolorProximityConfig
public static enum CanandcolorProximityConfig.IntegrationPeriod
extends Enum<CanandcolorProximityConfig.IntegrationPeriod>
Represents the valid integration periods for the proximity sensor.
The sensor operates by shining IR pulses and recording the reflected IR light.
Longer integration periods result in longer pulses which can sense farther distances
but saturate at closer distances (within like a cm or two).
Recommended default is k400us.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionfromIndex
(int v) Fetches the enum associated with the index value.int
getIndex()
Fetches the index associated with the enum.Returns the enum constant of this class with the specified name.values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
k25us
Uses a 25 microsecond period for IR pulse. -
k50us
Uses a 50 microsecond period for IR pulse. -
k100us
Uses a 100 microsecond period for IR pulse. -
k200us
Uses a 200 microsecond period for IR pulse. -
k400us
Uses a 400 microsecond period for IR pulse.
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
getIndex
public int getIndex()Fetches the index associated with the enum.- Returns:
- index value
-
fromIndex
Fetches the enum associated with the index value.- Parameters:
v
- int containing index value; only lower 2 bits are used- Returns:
- corresponding enum
-