Encoders with autonomous

Hi I have been researching this for quite some time, I can find examples of how to set up and do simple programming of the 4x encoders but could anyone show me an example of a auto code that would use them. We really need to get close to exact distances.

You can take the encoder distance and feed that into a PID controller, as long as you tune the P and D variables you can get extremely accurate movements as far as a few encoder ticks.