Package frclib.sensor
Class FrcAnalogInput
java.lang.Object
trclib.sensor.TrcSensor<TrcAnalogInput.DataType>
trclib.sensor.TrcAnalogInput
frclib.sensor.FrcAnalogInput
This class implements a platform dependent AnalogInput sensor extending TrcAnalogInput. It provides implementation
of the abstract methods in TrcAnalogInput.
-
Nested Class Summary
Nested classes/interfaces inherited from class trclib.sensor.TrcAnalogInput
TrcAnalogInput.DataType
Nested classes/interfaces inherited from class trclib.sensor.TrcSensor
TrcSensor.DataSource<D>, TrcSensor.SensorData<T>
-
Field Summary
Fields inherited from class trclib.sensor.TrcAnalogInput
ANALOGINPUT_DOUBLE_INTEGRATE, ANALOGINPUT_INTEGRATE, getInputElapsedTimer
-
Constructor Summary
ConstructorsConstructorDescriptionFrcAnalogInput
(String instanceName, int channel) Constructor: Creates an instance of the object.FrcAnalogInput
(String instanceName, int channel, TrcFilter[] filters) Constructor: Creates an instance of the object.FrcAnalogInput
(String instanceName, int channel, TrcFilter[] filters, boolean powerRailIs3V3) Constructor: Creates an instance of the object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method calibrates the sensor.getRawData
(int index, TrcAnalogInput.DataType dataType) This method returns the raw sensor data of the specified type.Methods inherited from class trclib.sensor.TrcAnalogInput
getData, getDoubleIntegratedData, getIntegratedData, getNormalizedData, printElapsedTime, resetIntegrator, setElapsedTimerEnabled, setEnabled, setInverted, setScale, setScaleAndOffset, toString
Methods inherited from class trclib.sensor.TrcSensor
calibrate, calibrate, getNumAxes, getProcessedData, isCalibrating, setInverted, setScale, setScaleAndOffset
-
Constructor Details
-
FrcAnalogInput
public FrcAnalogInput(String instanceName, int channel, TrcFilter[] filters, boolean powerRailIs3V3) Constructor: Creates an instance of the object.- Parameters:
instanceName
- specifies the instance name.channel
- specifies the analog input channel.filters
- specifies an array of filter objects, one for each axis, to filter sensor data. If no filter is used, this can be set to null.powerRailIs3V3
- specifies true if analog power rail is 3.3V, false if 5V.
-
FrcAnalogInput
Constructor: Creates an instance of the object.- Parameters:
instanceName
- specifies the instance name.channel
- specifies the analog input channel.filters
- specifies an array of filter objects, one for each axis, to filter sensor data. If no filter is used, this can be set to null.
-
FrcAnalogInput
Constructor: Creates an instance of the object.- Parameters:
instanceName
- specifies the instance name.channel
- specifies the analog input channel.
-
-
Method Details
-
calibrate
public void calibrate()This method calibrates the sensor. -
getRawData
This method returns the raw sensor data of the specified type.- Specified by:
getRawData
in classTrcAnalogInput
- Parameters:
index
- specifies the data index (not used).dataType
- specifies the data type.- Returns:
- raw sensor data of the specified type.
-