Package frclib.sensor
Class FrcAnalogEncoder
java.lang.Object
frclib.sensor.FrcAnalogEncoder
This class implements an Analog Absolute Encoders that implements the TrcEncoder interface to allow compatibility
to other types of encoders.
-
Constructor Summary
ConstructorsConstructorDescriptionFrcAnalogEncoder
(String instanceName, int channel) Constructor: Creates an instance of the object.FrcAnalogEncoder
(String instanceName, int channel, boolean powerRailIs3V3) Constructor: Creates an instance of the object. -
Method Summary
Modifier and TypeMethodDescriptionThis method returns the created Absolute Encoder object.double
This method reads the raw voltage from the analog input of the encoder.
-
Constructor Details
-
FrcAnalogEncoder
Constructor: Creates an instance of the object.- Parameters:
instanceName
- specifies the instance name.channel
- specifies the analog channel for the encoder.powerRailIs3V3
- specifies true if analog power rail is 3.3V, false if 5V.
-
FrcAnalogEncoder
Constructor: Creates an instance of the object.- Parameters:
instanceName
- specifies the instance name.channel
- specifies the analog channel for the encoder.
-
-
Method Details
-
getAbsoluteEncoder
This method returns the created Absolute Encoder object.- Returns:
- absolute encoder object.
-
getRawVoltage
public double getRawVoltage()This method reads the raw voltage from the analog input of the encoder.- Returns:
- raw voltage of the analog encoder.
-