public class LynxDigitalChannelController extends LynxController implements DigitalChannelController
LynxDigitalChannelController
provides access to the digital IO pins on a Lynx module.Modifier and Type | Class and Description |
---|---|
protected class |
LynxDigitalChannelController.PinProperties |
LynxController.PretendLynxModule
DigitalChannelController.Mode
HardwareDevice.Manufacturer
HardwareDeviceHealth.HealthStatus
RobotArmingStateNotifier.ARMINGSTATE, RobotArmingStateNotifier.Callback
Modifier and Type | Field and Description |
---|---|
static int |
apiPinFirst |
static int |
apiPinLast |
protected LynxDigitalChannelController.PinProperties[] |
pins |
static java.lang.String |
TAG |
context, hardwareDeviceHealth, isEngaged, isHardwareInitialized, isHooked, registeredCallbacks
tag
Constructor and Description |
---|
LynxDigitalChannelController(Context context,
LynxModule module) |
Modifier and Type | Method and Description |
---|---|
void |
forgetLastKnown() |
java.lang.String |
getDeviceName()
Returns a string suitable for display to the user as to the type of device.
|
DigitalChannel.Mode |
getDigitalChannelMode(int pin)
Get the mode of a digital channel
|
boolean |
getDigitalChannelState(int pin)
Get the state of a digital channel
If it's in OUTPUT mode, this will return the output bit.
|
SerialNumber |
getSerialNumber()
Returns the serial number of this USB module
|
protected java.lang.String |
getTag() |
void |
initializeHardware() |
void |
setDigitalChannelMode(int pin,
DigitalChannel.Mode mode)
Set the mode of a digital channel
|
void |
setDigitalChannelMode(int pin,
DigitalChannelController.Mode mode)
Deprecated.
|
void |
setDigitalChannelState(int pin,
boolean state)
Set the state of a digital channel
|
adjustHookingToMatchEngagement, close, disengage, doHook, doUnhook, engage, finishConstruction, floatHardware, getArmingState, getConnectionInfo, getHealthStatus, getHealthStatusOverride, getManufacturer, getModule, getVersion, hook, isArmed, isEngaged, moduleNowArmedOrPretending, moduleNowDisarmed, onModuleStateChange, registerCallback, resetDeviceConfigurationForOpMode, setHealthStatus, setHealthyIfArmed, unhook, unregisterCallback
handleException, handleSpecificException, handleSpecificException, handleSpecificException, handleSpecificException
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, getConnectionInfo, getManufacturer, getVersion, resetDeviceConfigurationForOpMode
public static final java.lang.String TAG
public static final int apiPinFirst
public static final int apiPinLast
protected final LynxDigitalChannelController.PinProperties[] pins
public LynxDigitalChannelController(Context context, LynxModule module) throws RobotCoreException, java.lang.InterruptedException
RobotCoreException
java.lang.InterruptedException
protected java.lang.String getTag()
getTag
in class LynxController
public void initializeHardware()
initializeHardware
in class LynxController
public void forgetLastKnown()
forgetLastKnown
in class LynxController
public java.lang.String getDeviceName()
HardwareDevice
getDeviceName
in interface HardwareDevice
getDeviceName
in class LynxController
public SerialNumber getSerialNumber()
RobotArmingStateNotifier
getSerialNumber
in interface DigitalChannelController
getSerialNumber
in interface RobotArmingStateNotifier
getSerialNumber
in class LynxController
public DigitalChannel.Mode getDigitalChannelMode(int pin)
DigitalChannelController
getDigitalChannelMode
in interface DigitalChannelController
pin
- channelpublic void setDigitalChannelMode(int pin, DigitalChannel.Mode mode)
DigitalChannelController
setDigitalChannelMode
in interface DigitalChannelController
pin
- channelmode
- INPUT or OUTPUT@Deprecated public void setDigitalChannelMode(int pin, DigitalChannelController.Mode mode)
setDigitalChannelMode
in interface DigitalChannelController
public boolean getDigitalChannelState(int pin)
DigitalChannelController
getDigitalChannelState
in interface DigitalChannelController
pin
- channelpublic void setDigitalChannelState(int pin, boolean state)
DigitalChannelController
The behavior of this method is undefined for digital channels in INPUT mode.
setDigitalChannelState
in interface DigitalChannelController
pin
- channelstate
- true to set; false to unset