Package ftclib.sensor

Class FtcTouchSensor

java.lang.Object
trclib.sensor.TrcDigitalInput
ftclib.sensor.FtcTouchSensor

public class FtcTouchSensor extends TrcDigitalInput
This class implements a platform dependent touch sensor extending TrcDigitalInput. It provides implementation of the abstract methods in TrcDigitalInput.
  • Field Details

    • touchSensor

      private final com.qualcomm.robotcore.hardware.TouchSensor touchSensor
  • Constructor Details

    • FtcTouchSensor

      public FtcTouchSensor(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap, String instanceName)
      Constructor: Creates an instance of the object.
      Parameters:
      hardwareMap - specifies the global hardware map.
      instanceName - specifies the instance name.
    • FtcTouchSensor

      public FtcTouchSensor(String instanceName)
      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 class TrcDigitalInput
      Returns:
      true if the touch sensor is active, false otherwise.