mirror of
https://github.com/BroncBotz3481/YAGSL
synced 2026-06-26 07:01:39 +00:00
Added new SparkMAX analog encoder option, fixed 'none' absolute encoder type
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package swervelib.encoders;
|
||||
|
||||
import edu.wpi.first.wpilibj.DriverStation;
|
||||
import edu.wpi.first.wpilibj.DutyCycleEncoder;
|
||||
|
||||
/**
|
||||
@@ -65,6 +66,18 @@ public class PWMDutyCycleEncoderSwerve extends SwerveAbsoluteEncoder
|
||||
return encoder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the velocity in degrees/sec.
|
||||
*
|
||||
* @return velocity in degrees/sec.
|
||||
*/
|
||||
@Override
|
||||
public double getVelocity()
|
||||
{
|
||||
DriverStation.reportWarning("The PWM Duty Cycle encoder may not report accurate velocities!", true);
|
||||
return encoder.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the encoder to factory defaults.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user