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.TouchSensor
Fields 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 TypeMethodDescriptionboolean
This 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:
getInputState
in classTrcDigitalInput
- Returns:
- true if the touch sensor is active, false otherwise.
-