Class CanandcolorDigoutState

java.lang.Object
com.reduxrobotics.sensors.canandcolor.CanandcolorDigoutState

public class CanandcolorDigoutState extends Object
Class representing the state of the Canandcolor digital outputs and the individual condition slots contributing to the outputs.
  • Constructor Details

    • CanandcolorDigoutState

      public CanandcolorDigoutState(byte[] field)
      Constructor -- used by the Canandcolor class to populate this object.
      Parameters:
      field - Digital output bit set from the CAN message
    • CanandcolorDigoutState

      public CanandcolorDigoutState()
      Instatiate with blank (all zeros) digout state.
  • Method Details

    • getDigoutValue

      public boolean getDigoutValue(CanandcolorDigitalOutput digout)
      Gets the output value of either digital output, which corresponds to what the Canandcolor is outputting on those pads. Note that this ignores things like 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

      public boolean getDigoutConditionSlotValue(CanandcolorDigitalOutput digout, int slot)
      Gets the output value of a specific condition slot contributing to a digital output. For more information about condition slots, see TODO
      Parameters:
      digout - the digital output associated with the condition slot
      slot - the condition slot index
      Returns:
      Whether or not that specific condition slot is returning true or not.