encoder_enable_pulse_decode(encoder_index, decoder_type, A, B)

Sets up an encoder hooked up to the pulse decoder of the controller.

>>> encoder_enable_pulse_decode(0,0,1,8,9)

This example shows how to set up encoder 0 for decoding a quadrature signal connected to pin 8 and 9.

Parameters

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

decoder_type: 

An integer determining how to treat the inputs on A and B.

0 is no encoder, pulse decoding is disabled.

1 is quadrature encoder, input A and B must be square waves with 90 degree offset. Direction of the conveyor can be determined.

2 is rising and falling edge on single input (A).

3 is rising edge on single input (A). 4 is falling edge on single input (A).

The controller can decode inputs at up to 40kHz

A:

Encoder input A pin. Must be 8-11.

B: 

Encoder input B pin. Must be 8-11.