Here is the problem: after connecting a US Digital Encoder, it doesn't seem to be returning any pulse data.
I wired it up by attaching Ground, 5V, and Channel A to the three prongs at Digital IO port 5 on the digital sidecar, and then connected Channel B to the signal prong at Digital IO port 6.
Here is the code I used:
Code:
#include "WPILib.h"
Encoder *myEncoder;
myEncoder = new Encoder(5,6);
myEncoder->Start();
myEncoder->SetDistancePerPulse(1); // Just something for testing.
//To print on the NetConsole Screen:
printf("Speed: %f\n", myEncoder->GetRate());
Is there anything wrong with either the wiring or the code? Thanks!