Help needed with Quadrature Encoders

To start out with, we are using c++ command based programming.
We have two quadrature 256 encoders on our drivetrain; one for each side. However, whenever we try to read from them in the code we either get 0.25, 0, or -0.25. It will most often return zero, and occasionally flash one of the other two numbers. If we set the distance per pulse to 256, the 0.25 does get lowered to a small decimal number, but the same behavior remains. We are fairly certain that the wiring is correct, and all of the firmware and images are up to date. We are creating encoders in the code using the encoder class and are then accessing them using encoder->GetDistance(). We have also tried other functions like GetRaw() and Get() but nothing seems to work. I would post the code but that is literally all that we are doing - creating the object and using GetDistance(). This same setup worked with our robot last year. Has anyone else ran into this same problem?

Tell us the exact brand and model number

on our drivetrain

Post a picture showing how they are mounted

We are fairly certain that the wiring is correct

Post a picture anyway

I would post the code but that is literally all that we are doing

Post your code anyway.

This is a classic symptom of the roborio reading one phase but not the other. This could be because of a broken encoder, or a wiring issue, or a code issue.

The pictures attached to this post are what we have in the code to test for values from the encoders. I doubt that it is because of broken encoders, because that means both of the encoders are broken, but we’ll check tomorrow. As far as electronics go, all I know is that they are confident it is plugged in correctly: ground, power, channel a, and channel b.

encoder2.PNG
encoder1.PNG
encoder3.PNG


encoder2.PNG
encoder1.PNG
encoder3.PNG