Quadrature Encoder Doesn't Work

I can’t seem to get shaft encoders to work or measure any rotation at all. Shaft encoder values don’t update in the debug menu in the RobotC IDE. I’ve double checked that it’s plugged into the correct ports, and tried using different encoders. Help would be appreciated. I’ve also tried using a different cortex to no avail.

This most likely means that you are cursed. I believe someone passed this curse onto you at your previous competition. I am not aware of any cure, so you have to switch to IMEs if you want encoders…
I’m kidding. IMEs are pure evil.

So, you should post your code.


#pragma config(Sensor, dgtl1, rightEncoder, sensorQuadEncoder)

Does one of your #pragma statements look like this? If so, are you plugging in the sensor in digital 1 and 2 and not analog? It’s sometimes difficult to plug wires in the correct ports.

Maybe post a picture of the debug menu too.

Thanks for the quick reply. After days of agony, it actually turns out that the Cortex battery has to be plugged in in order for the encoders to work. I assumed that they would work off of USB power like the other sensors, but that isn’t so.