Package ftclib.sensor
Class FtcTouchSensor
java.lang.Object
trclib.sensor.TrcDigitalInput
ftclib.sensor.FtcTouchSensor
This class implements a platform dependent touch sensor extending TrcDigitalInput. It provides implementation of
the abstract methods in TrcDigitalInput.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.qualcomm.robotcore.hardware.TouchSensorFields inherited from class trclib.sensor.TrcDigitalInput
getInputElapsedTimer, instanceName -
Constructor Summary
ConstructorsConstructorDescriptionFtcTouchSensor(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap, String instanceName) Constructor: Creates an instance of the object.FtcTouchSensor(String instanceName) Constructor: Creates an instance of the object. -
Method Summary
Modifier and TypeMethodDescriptionbooleanThis method returns the state of the touch sensor.Methods inherited from class trclib.sensor.TrcDigitalInput
isActive, printElapsedTime, setElapsedTimerEnabled, setInverted, toString
-
Field Details
-
touchSensor
private final com.qualcomm.robotcore.hardware.TouchSensor touchSensor
-
-
Constructor Details
-
FtcTouchSensor
Constructor: Creates an instance of the object.- Parameters:
hardwareMap- specifies the global hardware map.instanceName- specifies the instance name.
-
FtcTouchSensor
Constructor: Creates an instance of the object.- Parameters:
instanceName- specifies the instance name.
-
-
Method Details
-
getInputState
public boolean getInputState()This method returns the state of the touch sensor.- Specified by:
getInputStatein classTrcDigitalInput- Returns:
- true if the touch sensor is active, false otherwise.
-