This commit is contained in:
Abhishrek05
2024-02-20 19:19:21 -07:00
parent 69479ce1a9
commit 464f22f2c3
2 changed files with 20 additions and 6 deletions
@@ -1,5 +0,0 @@
package frc4388.utility.Configurable;
public abstract class Configurable {
}
@@ -1,4 +1,23 @@
package frc4388.utility.Configurable;
package frc4388.utility.configurable;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
public class ConfigurableDouble {
private double defualtValue;
private String name;
/**
* Creates an new ConfigurableDouble through Smart Dashboard.
* @param name the name of the Smart Dashboard key.
* @param defualtValue the initilization value
*/
public ConfigurableDouble(String name, double defualtValue) {
this.name = name;
this.defualtValue = defualtValue;
SmartDashboard.putNumber(name, defualtValue);
}
public double get() {
return SmartDashboard.getNumber(name, defualtValue);
}
}