We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7b2bf1b commit b82dd2fCopy full SHA for b82dd2f
src/main/java/org/carlmontrobotics/lib199/MotorControllerFactory.java
@@ -167,15 +167,7 @@ public static MotorControllerType getControllerType(SparkBase motor){
167
}
168
169
public static SparkBaseConfig sparkConfig(MotorConfig motorConfig){
170
- SparkBaseConfig config = null;
171
- switch(motorConfig.getControllerType()){
172
- case SPARK_MAX:
173
- config = new SparkMaxConfig();
174
- break;
175
- case SPARK_FLEX:
176
- config = new SparkFlexConfig();
177
178
- }
+ SparkBaseConfig config = motorConfig.controllerType.createConfig();
179
//configs that apply to all motors
180
config.idleMode(IdleMode.kBrake);
181
config.voltageCompensation(12);
0 commit comments