public final class HiTechnicNxtServoController extends HiTechnicNxtController implements ServoController
ServoController.PwmStatus
HardwareDevice.Manufacturer
Modifier and Type | Field and Description |
---|---|
protected static byte[] |
ADDRESS_CHANNEL_MAP |
protected static int |
ADDRESS_PWM |
protected static double |
apiPositionMax |
protected static double |
apiPositionMin |
protected LastKnown<java.lang.Double>[] |
commandedServoPositions |
protected static I2cAddr |
I2C_ADDRESS |
protected static int |
iRegWindowFirst |
protected static int |
iRegWindowMax |
protected LastKnown<java.lang.Boolean> |
lastKnownPwmEnabled |
protected static byte |
PWM_DISABLE |
protected static byte |
PWM_ENABLE |
protected static byte |
PWM_ENABLE_WITHOUT_TIMEOUT |
protected static int |
SERVO_FIRST |
protected static int |
SERVO_LAST |
protected static double |
servoPositionMax |
protected static double |
servoPositionMin |
context, i2cDevice, i2cDeviceSynch, isEngaged, isHardwareInitialized, isHooked
controller, physicalPort
Constructor and Description |
---|
HiTechnicNxtServoController(Context context,
I2cController module,
int physicalPort) |
Modifier and Type | Method and Description |
---|---|
protected void |
controllerNowArmedOrPretending()
intended as a subclass hook
|
protected void |
doHook() |
protected void |
doUnhook() |
protected void |
floatHardware() |
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.
|
ServoController.PwmStatus |
getPwmStatus()
Returns the enablement status of the collective set of servos connected to this controller
|
double |
getServoPosition(int servo)
Get the position of a servo at a given channel
|
int |
getVersion()
Version
|
void |
initializeHardware() |
void |
pwmDisable()
Disables all of the servos connected to this controller
|
void |
pwmEnable()
Enables all of the servos connected to this controller
|
void |
resetDeviceConfigurationForOpMode()
Resets the device's configuration to that which is expected at the beginning of an OpMode.
|
void |
setServoPosition(int servo,
double position)
Set the position of a servo at the given channel
|
adjustHookingToMatchEngagement, close, controllerNowDisarmed, disengage, engage, hook, isArmed, isEngaged, read8, unhook, write, write8
finishConstruction, getI2cController, getPort, onModuleStateChange
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
protected static final I2cAddr I2C_ADDRESS
protected static final int SERVO_FIRST
protected static final int SERVO_LAST
protected static final byte PWM_ENABLE
protected static final byte PWM_ENABLE_WITHOUT_TIMEOUT
protected static final byte PWM_DISABLE
protected static final byte[] ADDRESS_CHANNEL_MAP
protected static final int ADDRESS_PWM
protected static final int iRegWindowFirst
protected static final int iRegWindowMax
protected static final double apiPositionMin
protected static final double apiPositionMax
protected static final double servoPositionMin
protected static final double servoPositionMax
protected LastKnown<java.lang.Double>[] commandedServoPositions
protected LastKnown<java.lang.Boolean> lastKnownPwmEnabled
public HiTechnicNxtServoController(Context context, I2cController module, int physicalPort)
protected void controllerNowArmedOrPretending()
I2cControllerPortDeviceImpl
controllerNowArmedOrPretending
in class I2cControllerPortDeviceImpl
protected void doHook()
doHook
in class HiTechnicNxtController
public void initializeHardware()
initializeHardware
in class HiTechnicNxtController
protected void doUnhook()
doUnhook
in class HiTechnicNxtController
public HardwareDevice.Manufacturer getManufacturer()
HardwareDevice
getManufacturer
in interface HardwareDevice
getManufacturer
in class HiTechnicNxtController
public java.lang.String getDeviceName()
HardwareDevice
getDeviceName
in interface HardwareDevice
public java.lang.String getConnectionInfo()
HardwareDevice
getConnectionInfo
in interface HardwareDevice
public void resetDeviceConfigurationForOpMode()
HardwareDevice
resetDeviceConfigurationForOpMode
in interface HardwareDevice
public int getVersion()
HardwareDevice
getVersion
in interface HardwareDevice
public void pwmEnable()
ServoController
pwmEnable
in interface ServoController
public void pwmDisable()
ServoController
pwmDisable
in interface ServoController
public ServoController.PwmStatus getPwmStatus()
ServoController
getPwmStatus
in interface ServoController
public void setServoPosition(int servo, double position)
ServoController
setServoPosition
in interface ServoController
servo
- channel of servoposition
- from 0.0 to 1.0public double getServoPosition(int servo)
ServoController
getServoPosition
in interface ServoController
servo
- channel of servoprotected void floatHardware()
floatHardware
in class HiTechnicNxtController