-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'wpilib-2025' into develop
- Loading branch information
Showing
63 changed files
with
5,377 additions
and
3,753 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"enableCppIntellisense": false, | ||
"currentLanguage": "java", | ||
"projectYear": "2024" | ||
"projectYear": "2025beta" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Copyright (c) LASA Robotics and other contributors | ||
// Open Source Software; you can modify and/or share it under the terms of | ||
// the MIT license file in the root directory of this project. | ||
|
||
package com.revrobotics.spark; | ||
|
||
/** Spark helpers */ | ||
public class SparkHelpers { | ||
|
||
public enum SparkModel { | ||
SparkMax(0), | ||
SparkFlex(1), | ||
Unknown(255); | ||
|
||
final int id; | ||
|
||
SparkModel(int id) { | ||
this.id = id; | ||
} | ||
|
||
static SparkModel fromId(int id) { | ||
for (SparkModel model : values()) { | ||
if (model.id == id) return model; | ||
} | ||
return Unknown; | ||
} | ||
} | ||
/** | ||
* Enable mode which sets the output of the PID controllers to be voltage instead of duty cycle. | ||
* | ||
* <p>To disable, change or disable voltage compensation. Those settings will overwrite this one | ||
*/ | ||
// public static REVLibError enablePIDVoltageOutput(CANSparkBase spark) { | ||
// return REVLibError.fromInt(CANSparkMaxJNI.c_SparkMax_SetParameterUint32(spark.sparkMaxHandle, 74, 1)); | ||
// } | ||
|
||
/** | ||
* Get model of Spark | ||
* @param spark Spark to get model of | ||
* @return Model of Spark | ||
*/ | ||
public static SparkModel getSparkModel(SparkBase spark) { | ||
switch (spark.getSparkModel()) { | ||
case SparkFlex: | ||
return SparkModel.SparkFlex; | ||
case SparkMax: | ||
return SparkModel.SparkMax; | ||
default: | ||
return SparkModel.Unknown; | ||
} | ||
} | ||
|
||
public static long getSparkHandle(SparkBase spark) { | ||
return spark.sparkHandle; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.