Configuring a DetachedEncoder
This page discusses configuration concepts specific to DetachedEncoders, such as the MAXSpline Encoder. For more information on general configuration in REVLib, see this page.
Configuration Classes
The MAXSpine Encoder uses a common configuration class, DetachedEncoderConfig.
API Documentation
For more information about what configurations and sub-configuration classes each class provides, refer to the links below:
Persisting Parameters
Configuring a DetachedEncoder automatically persists the configuration settings between power cycles when calling the configure() method.
Persisting parameters involves saving them to the device's memory, which is time-intensive and blocks communication with the device.
Use Cases
It is recommended to update the majority of device parameters during the initial configuration of the device at the start of your program to ensure that the controller retains its configuration in the event of a power cycle during operation, e.g., due to a breaker trip or a brownout.
It is generally recommended not to make configuration updates mid-operation to avoid blocking the program and affecting the robot's performance.
Below is an example of either case:
Robot() {
DetachedEncoderConfig config = new DetachedEncoderConfig();
config
.inverted(true)
.velocityConversionFactor(1.23)
.positionConversionFactor(360);
// Persist parameters and reset any not explicitly set above to
// their defaults.
SplineEncoder splineEncoder = new SplineEncoder(42);
splineEncoder.configure(config, ResetMode.kResetSafeParameters);
}Last updated
Was this helpful?

