Hey guys, so I have a couple of questions for encoders.
I wired it correctly because live window shows values for speed.
1)Am I using the setDistancePerPulse() correctly?
2)I am getting 0 for getRate() method, is the code correct?
Code:
shooterMotor = new Talon(RobotMap.SHOOTER_MOTOR);
shooterEncoder = new Encoder(RobotMap.SHOOTER_ENCODER_A, RobotMap.SHOOTER_ENCODER_B, true, CounterBase.EncodingType.k4X);
shooterEncoder.setDistancePerPulse(4/360);//4:1 gear ratio
shooterEncoder.setPIDSourceParameter(Encoder.PIDSourceParameter.kRate);
shooterEncoder.start();
If anyone can help, that would be appreciated.