public class HiTechnicNxtTouchSensor extends LegacyModulePortDeviceImpl implements TouchSensor
HardwareDevice.Manufacturer
module, physicalPort
Constructor and Description |
---|
HiTechnicNxtTouchSensor(LegacyModule legacyModule,
int physicalPort) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this device
|
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 |
isPressed()
Return true if the touch sensor is being pressed
|
protected void |
moduleNowArmedOrPretending()
intended as a subclass hook
|
void |
resetDeviceConfigurationForOpMode()
Resets the device's configuration to that which is expected at the beginning of an OpMode.
|
java.lang.String |
status() |
java.lang.String |
toString() |
finishConstruction, getLegacyModule, getPort, moduleNowDisarmed, onModuleStateChange
public HiTechnicNxtTouchSensor(LegacyModule legacyModule, int physicalPort)
protected void moduleNowArmedOrPretending()
LegacyModulePortDeviceImpl
moduleNowArmedOrPretending
in class LegacyModulePortDeviceImpl
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String status()
public double getValue()
TouchSensor
getValue
in interface TouchSensor
public boolean isPressed()
TouchSensor
isPressed
in interface TouchSensor
public HardwareDevice.Manufacturer getManufacturer()
HardwareDevice
getManufacturer
in interface HardwareDevice
public java.lang.String getDeviceName()
HardwareDevice
getDeviceName
in interface HardwareDevice
public java.lang.String getConnectionInfo()
HardwareDevice
getConnectionInfo
in interface HardwareDevice
public int getVersion()
HardwareDevice
getVersion
in interface HardwareDevice
public void resetDeviceConfigurationForOpMode()
HardwareDevice
resetDeviceConfigurationForOpMode
in interface HardwareDevice
public void close()
HardwareDevice
close
in interface HardwareDevice