Enum Class DataSource
- All Implemented Interfaces:
DigoutPinConfig
,Serializable
,Comparable<DataSource>
,Constable
Data sources that digout channels can use to perform comparisons or output data directly as a
duty cycle on GPIO pin DIG-2.
All values are typically considered to be scaled between 0.0 and 1.0. For proximity, red,
green, blue, white, and HSV, the values that digout slots consider (and what the Rio would
read if it read the PWM outputs), they are generally equivalent to the values read through
functions like Canandcolor.getProximity()
or Canandcolor.getColor()
.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
Nested classes/interfaces inherited from interface com.reduxrobotics.sensors.canandcolor.DigoutPinConfig
DigoutPinConfig.RawConfigValue
-
Enum Constant Summary
Enum ConstantDescriptionBlue readingGreen readingHue readingProximity valueRed readingSaturation readingValue readingZero value (always reads zero) -
Field Summary
Fields inherited from interface com.reduxrobotics.sensors.canandcolor.DigoutPinConfig
kDigoutLogicActiveHigh, kDigoutLogicActiveLow, kDisabled
-
Method Summary
Modifier and TypeMethodDescriptionboolean
equals
(DigoutPinConfig other) Returns if two configurations are equivalent.static DataSource
fromIndex
(int v) Fetches the enum associated with the index value.int
getIndex()
Returns the associated index number for the enum (used in serialization)long
Serializes the digout config into a value writeable to device settings.static DataSource
Returns the enum constant of this class with the specified name.static DataSource[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
kZero
Zero value (always reads zero) -
kProximity
Proximity value -
kRed
Red reading -
kGreen
Green reading -
kBlue
Blue reading -
kHue
Hue reading -
kSaturation
Saturation reading -
kValue
Value reading
-
-
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()Returns the associated index number for the enum (used in serialization)- Returns:
- the associated index number for the enum.
-
fromIndex
Fetches the enum associated with the index value.- Parameters:
v
- int containing index value -- if index > max value, the modulo is used- Returns:
- corresponding enum
-
toOutputSettingData
public long toOutputSettingData()Description copied from interface:DigoutPinConfig
Serializes the digout config into a value writeable to device settings.- Specified by:
toOutputSettingData
in interfaceDigoutPinConfig
- Returns:
- 48-bit long
-
equals
Description copied from interface:DigoutPinConfig
Returns if two configurations are equivalent.- Specified by:
equals
in interfaceDigoutPinConfig
- Parameters:
other
- other config- Returns:
- true if equal
-