Package ftclib.sensor
Class FtcSensorTrigger
java.lang.Object
ftclib.sensor.FtcSensorTrigger
This class creates an FTC platform specific Sensor Trigger with the specified parameters.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final FtcAnalogInput
private final TrcAnalogSensor
private final FtcDigitalInput
private final String
private final TrcTrigger
-
Constructor Summary
ConstructorsConstructorDescriptionFtcSensorTrigger
(String instanceName, FtcSensorTrigger.SensorType sensorType, TrcAnalogSensor.AnalogDataSource analogSource, boolean sensorInverted, Double triggerThreshold) Constructor: Creates an instance of the object. -
Method Summary
Modifier and TypeMethodDescriptionprivate double
This method returns the analog sensor value.This method returns the created sensor trigger.toString()
This method returns the instance name.
-
Field Details
-
instanceName
-
digitalInput
-
analogInput
-
analogSensor
-
trigger
-
-
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
This method returns the instance name. -
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.
-