Class PhysicalEncoder
java.lang.Object
io.github.roboblazers7617.buttonbox.Control
io.github.roboblazers7617.buttonbox.controls.Knob
io.github.roboblazers7617.buttonbox.controls.PhysicalEncoder
A Knob controlled through Addresses by an Encoder that outputs relative
values.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDetermines if and how out-of-range encoder values should be looped. -
Constructor Summary
ConstructorsConstructorDescriptionPhysicalEncoder(String id, DoubleAddress positionAddress) Creates a new PhysicalPotentiometer. -
Method Summary
Modifier and TypeMethodDescriptionSets the loop mode of the encoder.setScale(double scale) Sets the scaling of the encoder values.voidUpdates the control's state on the client.Methods inherited from class io.github.roboblazers7617.buttonbox.controls.Knob
getPosition, setPosition, setupNetworkTables, setupSimulation, updateServerMethods inherited from class io.github.roboblazers7617.buttonbox.Control
getId, getTable, setTable, updateHardware, updateOnClient
-
Constructor Details
-
PhysicalEncoder
Creates a new PhysicalPotentiometer.- Parameters:
id- The ID string for the PhysicalPotentiometer to use.positionAddress- The Address used for the position. A value of 0.5 is the center, values above that are movement in the positive direction, and values below that are movement in the negative direction.
-
-
Method Details
-
updateClient
public void updateClient()Description copied from class:ControlUpdates the control's state on the client. This should get any feedback from the server, but this should not interface with the buttonbox hardware.This doesn't do anything by default, and should be overridden by the class inheritting this.
- Overrides:
updateClientin classKnob
-
setLoopMode
Sets the loop mode of the encoder.- Parameters:
mode- Mode to set.- Returns:
- The modified object for method chaining.
-
setScale
Sets the scaling of the encoder values.- Parameters:
scale- Scale to set.- Returns:
- The modified object for method chaining.
-