Programming Qudrature Shaft Encoders with RobotC

When I try to see the value for the quadrature shaft encoders, the values skip from 23 to 3000, sometimes going into the negatives. So I think it might be how I plugged the wires into the cortex since I sort of guessed the placement. I plugged all 4 wires for the 2 shaft encoders into the digital ports then the analog ports but that didn’t work. I looked at this: … rature.pdf
which shows a vex PIC microcontroller V0.5 but I use a vex cortex microcontroller so I’m not exactly sure where to place all the wires.

I saw that you posted this in the ROBOTC forums as well. The same group does the support there and here, so no need to post in both places. :slight_smile:

If you check out the VEX Cortex Video Trainer: and go to the Movement > Shaft Encoders section, you’ll find some pretty good tutorials on using the encoders with the Cortex.

Also, if you check out the Setup > Build section, we have several sets of building instructions that show where to plug in the encoders. The two wires for shaft encoders must always get plugged in on neighboring digital ports (1&2, 2&3, ect).