Hey, I am a programmer from Team 3859. Right now we are working on using encoders. We use Greyhill 63R encoders and we plug them directly into the Talon using the Andy Mark Universal Breakout Board that plugs directly into the Talon SRX.
public void encSetUp() {
Map.leftfront.changeControlMode(CANTalon.TalonControlMode.Position;
Map.leftfront.setControlMode(CANTalon.TalonControlMode.Position.value);
Map.leftfront.setFeedbackDevice(FeedbackDevice.QuadEncoder);
Map.leftfront.configEncoderCodesPerRev(512);
}
This is the code I used to set up the encoder. In the autonomous code, i just read the encoder position based of off the encoder. We are just trying to read the encoder values at this point. PID and further development is later, for now we are just trying to read encoder values.
Try creating a separate FeedbackDevice Object and then setting that feedback device to a quad encoder
Then set the Talons feedback device to that FeedbackDevice object
Then running a simple… to get rpm and print it to the console. Read that to see if you’re getting values.
exampleTalon.getSpeed();
If that mess of an explanation doesn’t help here’s a project I did using encoders for a small competition my team did. Look at the shooter code to see the things we actually used encoders for https://github.com/sethstobart/TeamWon
Hmu with any further questions I’d be glad to answer I love talking about this stuff: [email protected]
I did actually close the parenthesis in the actual code, however it just didn’t show up on here. We are getting no output with no error message. I do have something that reads the encoder however i just noticed that i put the print in robotinit so it actually wasnt read the change in values. Tonight ill make sure to put it in autoperiodic and see if it outputs values,