Package ftclib.sensor

Class FtcSensorTrigger

java.lang.Object
ftclib.sensor.FtcSensorTrigger

public class FtcSensorTrigger extends Object
This class creates an FTC platform specific Sensor Trigger with the specified parameters.
  • Field Details

  • Constructor Details

    • FtcSensorTrigger

      public FtcSensorTrigger(String instanceName, FtcSensorTrigger.SensorType sensorType, TrcAnalogSensor.AnalogDataSource analogSource, boolean sensorInverted, Double triggerThreshold)
      Constructor: Creates an instance of the object.
      Parameters:
      instanceName - specifies the instance name.
      sensorType - specifies the sensor type.
      analogSource - specifies the analog sensor source, only applicable if the sensor type is AnalogSource.
      sensorInverted - specifies true if the sensor polarity is inverted.
      triggerThreshold - specifies the trigger threshold value if it is an analog sensor, null if sensor is digital.
  • Method Details

    • toString

      @NonNull public String toString()
      This method returns the instance name.
      Overrides:
      toString in class Object
      Returns:
      instance name.
    • getTrigger

      public TrcTrigger getTrigger()
      This method returns the created sensor trigger.
      Returns:
      sensor trigger.
    • getAnalogValue

      private double getAnalogValue()
      This method returns the analog sensor value.
      Returns:
      analog sensor value.