NextAnalogInput
A wrapper around an AnalogInput that provides convenient access to raw voltage readings as well as a normalized, optionally transformed value.
The hardware device is resolved lazily, so constructing an instance of this class does not require the hardware map to be ready yet.
Inherits from AnalogFeedback so that any NextAnalogInput can also be used directly as a by-delegate returning an angle in radians (e.g. for feedback CR servos).
Parameters
A lambda that resolves and returns the underlying AnalogInput.
An optional transformation applied to the normalized voltage ratio (raw voltage divided by maxVoltage) before it is exposed via value. Defaults to the identity function.
The voltage that corresponds to a normalized value of 1.0. Defaults to 3.3 volts.
Constructors
Creates a NextAnalogInput by looking up the AnalogInput in the hardware map by its configured name.
Creates a NextAnalogInput directly from a NextLynxModule and analog channel number, bypassing the hardware map.
Properties
The raw, untransformed voltage currently read from the analog input.
The normalized reading from the analog input, computed as rawVoltage divided by maxVoltage and passed through customTransformation.