encoder_get_tick_count(encoder_index, opt="")

Returns the filtered tick count of the designated encoder.

>>> encoder_get_tick_count(0)

This example returns the current filtered tick count of encoder 0.

Parameters

encoder_index: Index of the encoder to query. Must be either 0 or 1.

opt: Optional option parameter. Default is opt="". Get the raw unfiltered integer value by opt="raw".

Return Value

The filtered conveyor encoder tick count (float) or the raw value (int32)

Example command 1: encoder_get_tick_count(0)

This example returns the current filtered tick count of encoder 0.
Use caution when subtracting encoder tick counts as it wraps around when reaching the maximum count value. The range of the filtered encoder value is [0; 65536[.
Please see the function encoder_unwind_delta_tick_count.

Example command 2: encoder_get_tick_count(1, opt="raw")

This example returns the current raw tick count of encoder 1.
Use caution when subtracting encoder tick counts.
The range of the raw encoder value is [-2³¹, 2³¹[.