@AnalogSensorType @DeviceProperties(name="@string/configTypeMRTouchSensor", xmlTag="ModernRoboticsAnalogTouchSensor", builtIn=true, description="@string/mr_touch_sensor_description") public class ModernRoboticsTouchSensor extends java.lang.Object implements TouchSensor
ModernRoboticsTouchSensor is the driver for a Modern Robotics Touch Sensor.
This can operate on either a DigitalChannelController or on an AnalogInputController.HardwareDevice.Manufacturer| Constructor and Description |
|---|
ModernRoboticsTouchSensor(AnalogInputController analogController,
int physicalPort) |
ModernRoboticsTouchSensor(DigitalChannelController digitalController,
int physicalPort) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this device
|
double |
getAnalogVoltageThreshold() |
java.lang.String |
getConnectionInfo()
Get connection information about this device in a human readable format
|
java.lang.String |
getDeviceName()
Returns a string suitable for display to the user as to the type of device.
|
HardwareDevice.Manufacturer |
getManufacturer()
Returns an indication of the manufacturer of this device.
|
double |
getValue()
Represents how much force is applied to the touch sensor; for some touch sensors
this value will only ever be 0 or 1.
|
int |
getVersion()
Version
|
boolean |
isAnalog() |
boolean |
isDigital() |
boolean |
isPressed()
Return true if the touch sensor is being pressed
|
void |
resetDeviceConfigurationForOpMode()
Resets the device's configuration to that which is expected at the beginning of an OpMode.
|
void |
setAnalogVoltageThreshold(double threshold) |
java.lang.String |
toString() |
public ModernRoboticsTouchSensor(DigitalChannelController digitalController, int physicalPort)
public ModernRoboticsTouchSensor(AnalogInputController analogController, int physicalPort)
public boolean isDigital()
public boolean isAnalog()
public double getAnalogVoltageThreshold()
public void setAnalogVoltageThreshold(double threshold)
public java.lang.String toString()
toString in class java.lang.Objectpublic double getValue()
TouchSensorgetValue in interface TouchSensorpublic boolean isPressed()
TouchSensorisPressed in interface TouchSensorpublic HardwareDevice.Manufacturer getManufacturer()
HardwareDevicegetManufacturer in interface HardwareDevicepublic java.lang.String getDeviceName()
HardwareDevicegetDeviceName in interface HardwareDevicepublic java.lang.String getConnectionInfo()
HardwareDevicegetConnectionInfo in interface HardwareDevicepublic int getVersion()
HardwareDevicegetVersion in interface HardwareDevicepublic void resetDeviceConfigurationForOpMode()
HardwareDeviceresetDeviceConfigurationForOpMode in interface HardwareDevicepublic void close()
HardwareDeviceclose in interface HardwareDevice