E4P Encoders not workind

Our encoders don’t return any value when I used the Encoder class (C++ WPIlib.) Here’s what I have to configure and read the encoder.

I ended up straight up copying the example code from the WPIlib documentation

We have confirmed that the encoders are on the correct digital input on the robot rio.



Encoder *leftEncode;	
leftEncode = new Encoder(6, 7, false, Encoder::k4X);

leftEncode->SetMaxPeriod(.1);
leftEncode->SetMinRate(10);
leftEncode->SetDistancePerPulse(5);
leftEncode->SetReverseDirection(true);
leftEncode->SetSamplesToAverage(7);

SmartDashboard::PutNumber("Encoder One value", leftEncode->GetRate());