Configurable Parameters are parameters that are linked to keys in the config.json file. You can edit them either by editing the config.json file directly and reloading, or using [AdvantageScope-3044](https://github.com/FRCTeam3044/AdvantageScope-3044). If you have a group of configurable parameters, consider a [Configurable Class](Configurable-Classes.md) instead. ## Creating a configurable parameter Configurable params are created like this: ```java ConfigurableParameter = new ConfigurableParameter(defaultValue, key, /* The json key */ consumer // (Optional) Setter method of the parameter (e.g. this::updateParam) */ ``` > Please avoid using commas (,) in the key name, it can cause issues over the NT interface. ## Using a configurable paramter To use a configurable parameter, simply call `param.get()`. This will retrieve the value of the parameter. This will **not** retrieve the latest value from the config file, only the value from the most recent reload. You will have to call reload manually or use the NT Interface. ## Full example ```java // Declaration ConfigurableParameter speedLimit = new ConfigurableParameter(5, "drive/speedLimit"); //... // Usage speed = Math.min(speedLimit.get(), speed) ``` ### Example with a consumer ```java // Declaration ConfigurableParameter speedLimit = new ConfigurableParameter(5, "drive/speedLimit", this::setSpeedLimit); //... // Consumer public void setSpeedLimit(double newLimit){ driveHandler.speedLimit = newLimit; } ```