Package frclib.sensor

Class FrcAnalogEncoder

java.lang.Object
frclib.sensor.FrcAnalogEncoder

public class FrcAnalogEncoder extends Object
This class implements an Analog Absolute Encoders that implements the TrcEncoder interface to allow compatibility to other types of encoders.
  • Constructor Details

    • FrcAnalogEncoder

      public FrcAnalogEncoder(String instanceName, int channel, boolean powerRailIs3V3)
      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

      public FrcAnalogEncoder(String instanceName, int channel)
      Constructor: Creates an instance of the object.
      Parameters:
      instanceName - specifies the instance name.
      channel - specifies the analog channel for the encoder.
  • Method Details

    • getAbsoluteEncoder

      public TrcAbsoluteEncoder 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.