Class DigoutSlotState

java.lang.Object
com.reduxrobotics.sensors.canandcolor.digout.DigoutSlotState

public class DigoutSlotState extends Object
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

    Constructors
    Constructor
    Description
    Instatiate with blank (all zeros) digout state.
    DigoutSlotState(byte[] field)
    Constructor -- used by the Canandcolor class to populate this object.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Gets the boolean value of a specific digout slot contributing to a digital output.
    boolean
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DigoutSlotState

      public DigoutSlotState(byte[] field)
      Constructor -- used by the Canandcolor 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

      public 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.
      Parameters:
      digout - The digital output whose value is to be returned
      Returns:
      the boolean state of that digital output
    • getDigoutConditionSlotValue

      public boolean getDigoutConditionSlotValue(Canandcolor.Digout digout, int slot)
      Gets the boolean value of a specific digout slot contributing to a digital output.
      Parameters:
      digout - the digital output associated with the slot
      slot - the slot index
      Returns:
      Whether or not that specific slot is returning true or not.