Class DigoutSlotState
java.lang.Object
com.reduxrobotics.sensors.canandcolor.digout.DigoutSlotState
Class representing the state of the Canandcolor digout slots.
The states of individual logic slots get broadcasted over CAN for debugging purposes.
See
DigoutSlot
for how digout slots work.-
Constructor Summary
ConstructorDescriptionInstatiate with blank (all zeros) digout state.DigoutSlotState
(byte[] field) Constructor -- used by theCanandcolor
class to populate this object. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getDigoutConditionSlotValue
(Canandcolor.Digout digout, int slot) Gets the boolean value of a specific digout slot contributing to a digital output.boolean
getDigoutValue
(Canandcolor.Digout digout) Gets the output value of either digital output, which corresponds to what the Canandcolor is outputting on those pads (assuming digout slot mode rather than duty cycle) Note that this ignores normally open/normally connected, so even if the board output is high electrically, the digital output state may be false.
-
Constructor Details
-
DigoutSlotState
public DigoutSlotState(byte[] field) Constructor -- used by theCanandcolor
class to populate this object.- Parameters:
field
- Digital output bit set from the CAN message
-
DigoutSlotState
public DigoutSlotState()Instatiate with blank (all zeros) digout state.
-
-
Method Details
-
getDigoutValue
Gets the output value of either digital output, which corresponds to what the Canandcolor is outputting on those pads (assuming digout slot mode rather than duty cycle) Note that this ignores normally open/normally connected, so even if the board output is high electrically, the digital output state may be false.- Parameters:
digout
- The digital output whose value is to be returned- Returns:
- the boolean state of that digital output
-
getDigoutConditionSlotValue
Gets the boolean value of a specific digout slot contributing to a digital output.- Parameters:
digout
- the digital output associated with the slotslot
- the slot index- Returns:
- Whether or not that specific slot is returning true or not.
-