There's lots of resources out there.
Look for team github repositories:
https://www.google.com/#q=frc+robot+...ite:github.com
Big list o' FRC projects -
https://github.com/flamingchickens15...tware-releases
More Codes -
https://firstwiki.github.io/wiki/robot-code-directory
WPI screensteps live has lots of example including information on how to interface with the encoders:
http://wpilib.screenstepslive.com/s/...or-other-shaft
http://wpilib.screenstepslive.com/s/4485/m/13810
Also numerous example programs came with the eclipse plugins:
https://github.com/wpilibsuite/Eclip...lates/examples
Take a look at
gearsbot, or simpler (not full robot code) examples like
Encoder