Reading index from REV Through Bore Encoder

We’d like to use the Index input on the REV Through Bore Encoder to count the revolutions of our motor rather than counting the “ticks”. I’ve read through the WPILIB docs but still am not sure what functions to use.

I know we can calculate the revolutions of the motor using the A and B inputs but it would be really handy to get the value using only a single DIO input port (for the Index line). Is this possible?

What you want to use is the “PWM” output of the encoder, connected to a DIO input on the Rio, and use the DutyCycleEncoder class. This will give you absolute position to 10-bit resolution over multiple rotations.

If you truly want just 1 pulse per rotation, you can use the index pin to a DIO input and use the Counter class.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.