diff --git a/src/main/java/org/carlmontrobotics/lib199/MotorErrors.java b/src/main/java/org/carlmontrobotics/lib199/MotorErrors.java index 7e8249f..686fd8c 100644 --- a/src/main/java/org/carlmontrobotics/lib199/MotorErrors.java +++ b/src/main/java/org/carlmontrobotics/lib199/MotorErrors.java @@ -105,6 +105,12 @@ public static CANSparkMax createDummySparkMax() { public static void reportSparkMaxTemp(CANSparkMax spark, TemperatureLimit temperatureLimit) { reportSparkMaxTemp(spark, temperatureLimit.limit); } + + public static boolean isSparkMaxOverheated(CANSparkMax spark){ + int id = spark.getDeviceId(); + int motorMaxTemp = sparkTemperatureLimits.get(id); + return ( spark.getMotorTemperature() >= motorMaxTemp ); + } public static void reportSparkMaxTemp(CANSparkMax spark, int temperatureLimit) { int id = spark.getDeviceId();