UpDownCounter

class wpilib.UpDownCounter(channel: SupportsInt | SupportsIndex, configuration: wpilib._wpilib.EdgeConfiguration)

Bases: Sendable

Up Down Counter.

This class can count edges on a single digital input or count up based on an edge from one digital input and down on an edge from another digital input.

Constructs a new UpDown Counter.

Parameters:
  • channel – The DIO channel

  • configuration – Edge configuration

getCount() int

Gets the current count.

Returns:

The current count.

reset() None

Resets the current count.

setEdgeConfiguration(configuration: wpilib._wpilib.EdgeConfiguration) None

Sets the configuration for the channel.

Parameters:

configuration – The channel configuration.