Package frclib.sensor
Class FrcAnalogSensor
java.lang.Object
edu.wpi.first.wpilibj.AnalogInput
frclib.sensor.FrcAnalogSensor
- All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable
,AutoCloseable
public class FrcAnalogSensor
extends edu.wpi.first.wpilibj.AnalogInput
This class implements an analog sensor that provides method to read the sensor and scale to proper unit.
-
Constructor Summary
ConstructorsConstructorDescriptionFrcAnalogSensor
(String instanceName, int analogChannel, double sensorScale, double sensorBias) Constructor: Create an instance of the object. -
Method Summary
Modifier and TypeMethodDescriptiondouble
This method reads the sensor value and converts it to the scaled unit.toString()
This method returns the instance name.Methods inherited from class edu.wpi.first.wpilibj.AnalogInput
close, getAccumulatorCount, getAccumulatorOutput, getAccumulatorValue, getAverageBits, getAverageValue, getAverageVoltage, getChannel, getGlobalSampleRate, getLSBWeight, getOffset, getOversampleBits, getValue, getVoltage, initAccumulator, initSendable, isAccumulatorChannel, resetAccumulator, setAccumulatorCenter, setAccumulatorDeadband, setAccumulatorInitialValue, setAverageBits, setGlobalSampleRate, setOversampleBits, setSimDevice
-
Constructor Details
-
FrcAnalogSensor
public FrcAnalogSensor(String instanceName, int analogChannel, double sensorScale, double sensorBias) Constructor: Create an instance of the object.- Parameters:
instanceName
- specifies the instance name.analogChannel
- specifies the analog channel the pressure sensor is on.sensorScale
- specifies the scale factor to convert voltage into proper unit.sensorBias
- specifies the sensor voltage bias.
-
-
Method Details