Charlie,
I actually have encoder code on the link I just reposted (for the Pixy code) as well.
Here is a snippet...
public class Robot extends TimedRobot {
private final Encoder leftEncoder = new Encoder(leftEncPortA, leftEncPortB);
...
...
@Override
public void robotPeriodic() {
leftSpeed = leftEncoder.getRate();
SmartDashboard.putNumber("Left Speed", leftSpeed);
//Sorry, I have no idea how to do code formatting in Google Groups
I am using the same pins you are for the left encoder and am using High current DIO for the motor (PWM0). The full code is
here. I also have a distance (I did not do any calibration so the units are not really inches, but encoder ticks) PID working
here.
I am using
vex encoders on this robot, but I also got the built-in encoders working with t
his base (working is a relative term, they are incredibly noisy and unreliable). This is not that great of an option (unless you want a really nice small robot platform. For the Vex Encoder, I made a cable by using a typical PWM Y cable, and cutting the ends off, and changing the one end to a 4 pin Molex which splits the power and ground line. Then I cut off the spliced signal line from one side and added the other signal line before putting 3pin Molex (or dupont, I forget which, and they are tucked in the belly of the drive base now) connectors on the two pigtails.