This page will discuss information about configuration concepts specific to the Servo Hub. For more information on general configuration in REVLib, see this page.
Configuration Classes
Though Servo Hub has its own configuration class, ServoHubConfig, the majority of the configuration occurs in the ServoChannelConfig class.
API Documentation
For more information about what configurations and sub-configuration classes the Servo Hub provides, refer to the links below:
ServoHubConfig
Configuring a Servo Hub automatically persists the configuration settings between power cycles when calling the configure() method.
Persisting parameters involves saving them to the Servo Hub's memory, which is time-intensive and blocks communication with the device.
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 updates to the configuration mid-operation to avoid blocking the program and affecting the performance of the robot.
Robot(){ServoHubConfigconfig=newServoHubConfig(); config.channel0.pulseRange(500,1500,2500).disableBehavior(ServoChannelConfig.BehaviorWhenDisabled.kSupplyPower);// Persist parameters and reset any not explicitly set above to// their defaults.servoHub.configure(config,ServoHub.ResetMode.kResetSafeParameters);}voidreduceRange(){ServoHubConfigconfig=newServoHubConfig();config.channel0.pulseRange(500,1500,2500)// Don't reset the parameters that are not explicitly set aboveservoHub.configure(config,ServoHub.ResetMode.kNoResetSafeParameters);}
usingnamespacerev::servohub;Robot(){ ServoHubConfig config; config .channel0.pulseRange(500,1500,2500) .disableBehavior(ServoChannelConfig::BehaviorWhenDisabled::kSupplyPower); // Persist parameters and reset any not explicitly set above to // their defaults.servoHub.configure(config,ServoHub::ResetMode::kResetSafeParameters);}voidreduceRange(){ ServoHubConfig config;config.channel0.pulseRange(500,1500,2500) // Don't reset the parameters the at are not explicitly set aboveservoHub.configure(config,ResetMode.kNoResetSafeParameters);}