Class GearTooth

  • All Implemented Interfaces:
    CounterBase, PIDSource, Sendable, AutoCloseable

    @Deprecated(since="2020",
                forRemoval=true)
    public class GearTooth
    extends Counter
    Deprecated, for removal: This API element is subject to removal in a future version.
    The only sensor this works with is no longer available and no teams use it according to FMS usage reporting.
    Alias for counter class. Implement the gear tooth sensor supplied by FIRST. Currently there is no reverse sensing on the gear tooth sensor, but in future versions we might implement the necessary timing in the FPGA to sense direction.
    • Constructor Detail

      • GearTooth

        public GearTooth​(int channel)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Construct a GearTooth sensor given a channel.

        No direction sensing is assumed.

        Parameters:
        channel - The GPIO channel that the sensor is connected to.
      • GearTooth

        public GearTooth​(int channel,
                         boolean directionSensitive)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Construct a GearTooth sensor given a channel.
        Parameters:
        channel - The DIO channel that the sensor is connected to. 0-9 are on-board, 10-25 are on the MXP port
        directionSensitive - True to enable the pulse length decoding in hardware to specify count direction.
      • GearTooth

        public GearTooth​(DigitalSource source,
                         boolean directionSensitive)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Construct a GearTooth sensor given a digital input. This should be used when sharing digital inputs.
        Parameters:
        source - An existing DigitalSource object (such as a DigitalInput)
        directionSensitive - True to enable the pulse length decoding in hardware to specify count direction.
      • GearTooth

        public GearTooth​(DigitalSource source)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Construct a GearTooth sensor given a digital input. This should be used when sharing digital inputs.

        No direction sensing is assumed.

        Parameters:
        source - An object that fully describes the input that the sensor is connected to.
    • Method Detail

      • enableDirectionSensing

        public void enableDirectionSensing​(boolean directionSensitive)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Common code called by the constructors.
      • initSendable

        public void initSendable​(SendableBuilder builder)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: Sendable
        Initializes this Sendable object.
        Specified by:
        initSendable in interface Sendable
        Overrides:
        initSendable in class Counter
        Parameters:
        builder - sendable builder