Notifier

class wpilib.Notifier(handler: collections.abc.Callable[[], None])

Bases: pybind11_object

Create a Notifier for timer event notification.

Parameters:

handler – The handler is called at the notification time which is set using StartSingle or StartPeriodic.

getOverrun() int

Gets the overrun count.

An overrun occurs when a notifier’s alarm is not serviced before the next scheduled alarm time.

Returns:

overrun count

setCallback(handler: collections.abc.Callable[[], None]) None

Change the handler function.

Parameters:

handler – Handler

setName(name: str) None

Sets the name of the notifier. Used for debugging purposes only.

Parameters:

name – Name

startPeriodic(period: wpimath.units.seconds) None

Register for periodic event notification.

A timer event is queued for periodic event notification. Each time the interrupt occurs, the event will be immediately requeued for the same time interval.

Parameters:

period – Period to call the handler starting one period after the call to this method.

startSingle(delay: wpimath.units.seconds) None

Register for single event notification.

A timer event is queued for a single event after the specified delay.

Parameters:

delay – Amount of time to wait before the handler is called.

stop() None

Stop timer events from occurring.

Stop any repeating timer events from occurring. This will also remove any single notification events from the queue.

If a timer-based call to the registered handler is in progress, this function will block until the handler call is complete.