public final class HiTechnicNxtDcMotorController extends HiTechnicNxtController
Modifier and Type | Field and Description |
---|---|
protected static byte[] |
ADDRESS_MOTOR_CURRENT_ENCODER_VALUE_MAP |
protected static byte[] |
ADDRESS_MOTOR_MODE_MAP |
protected static byte[] |
ADDRESS_MOTOR_POWER_MAP |
protected static byte[] |
ADDRESS_MOTOR_TARGET_ENCODER_VALUE_MAP |
protected static double |
apiPowerMax |
protected static double |
apiPowerMin |
protected static byte |
bPowerBrake |
protected static byte |
bPowerFloat |
protected static byte |
bPowerMax |
protected static byte |
bPowerMin |
static int |
BUSY_THRESHOLD |
protected static byte |
cbEncoder |
protected static byte |
CHANNEL_MODE_FLAG_SELECT_RESET |
protected static byte |
CHANNEL_MODE_FLAG_SELECT_RUN_CONSTANT_SPEED_NXT |
protected static byte |
CHANNEL_MODE_FLAG_SELECT_RUN_POWER_CONTROL_ONLY_NXT |
protected static byte |
CHANNEL_MODE_FLAG_SELECT_RUN_TO_POSITION |
protected static int |
CHANNEL_MODE_MASK_BUSY |
protected static int |
CHANNEL_MODE_MASK_EMPTY_D5 |
protected static int |
CHANNEL_MODE_MASK_ERROR |
protected static int |
CHANNEL_MODE_MASK_LOCK |
protected static int |
CHANNEL_MODE_MASK_NO_TIMEOUT |
protected static int |
CHANNEL_MODE_MASK_REVERSE |
protected static int |
CHANNEL_MODE_MASK_SELECTION |
protected static I2cAddr |
I2C_ADDRESS |
protected static int |
iRegWindowFirst |
protected static int |
iRegWindowMax |
protected static int |
MOTOR_FIRST |
protected static int |
MOTOR_LAST |
protected static int |
MOTOR_MAX |
protected static int |
OFFSET_UNUSED |
context, i2cDevice, i2cDeviceSynch, isEngaged, isHardwareInitialized, isHooked
Constructor and Description |
---|
HiTechnicNxtDcMotorController(android.content.Context context,
LegacyModule module,
int physicalPort) |
Modifier and Type | Method and Description |
---|---|
protected void |
controllerNowArmedOrPretending()
Our controller is newly armed or pretending, or we're newly constructed on a controller
|
protected void |
doHook() |
protected void |
doUnhook() |
protected void |
floatHardware() |
java.lang.String |
getConnectionInfo() |
java.lang.String |
getDeviceName() |
int |
getMotorCurrentPosition(int motor) |
DcMotor.RunMode |
getMotorMode(int motor) |
double |
getMotorPower(int motor) |
boolean |
getMotorPowerFloat(int motor) |
int |
getMotorTargetPosition(int motor) |
MotorConfigurationType |
getMotorType(int motor) |
DcMotor.ZeroPowerBehavior |
getMotorZeroPowerBehavior(int motor) |
int |
getVersion() |
double |
getVoltage() |
void |
initializeHardware() |
protected void |
initPID() |
boolean |
isBusy(int motor) |
static DcMotor.RunMode |
modeFromByte(byte flag) |
static byte |
modeToByte(DcMotor.RunMode mode) |
void |
resetDeviceConfigurationForOpMode() |
void |
resetDeviceConfigurationForOpMode(int motor) |
void |
setMotorMode(int motor,
DcMotor.RunMode mode) |
void |
setMotorPower(int motor,
double power) |
protected void |
setMotorPowerFloat(int motor) |
void |
setMotorTargetPosition(int motor,
int position) |
void |
setMotorType(int motor,
MotorConfigurationType motorType) |
void |
setMotorZeroPowerBehavior(int motor,
DcMotor.ZeroPowerBehavior zeroPowerBehavior) |
protected void |
validateMotor(int motor) |
adjustHookingToMatchEngagement, close, controllerNowDisarmed, disengage, engage, getManufacturer, hook, isArmed, isEngaged, read8, unhook, write, write8
protected static final int MOTOR_FIRST
protected static final int MOTOR_LAST
protected static final int MOTOR_MAX
protected static final I2cAddr I2C_ADDRESS
protected static final int OFFSET_UNUSED
protected static final int CHANNEL_MODE_MASK_SELECTION
protected static final int CHANNEL_MODE_MASK_LOCK
protected static final int CHANNEL_MODE_MASK_REVERSE
protected static final int CHANNEL_MODE_MASK_NO_TIMEOUT
protected static final int CHANNEL_MODE_MASK_EMPTY_D5
protected static final int CHANNEL_MODE_MASK_ERROR
protected static final int CHANNEL_MODE_MASK_BUSY
protected static final byte CHANNEL_MODE_FLAG_SELECT_RUN_POWER_CONTROL_ONLY_NXT
protected static final byte CHANNEL_MODE_FLAG_SELECT_RUN_CONSTANT_SPEED_NXT
protected static final byte CHANNEL_MODE_FLAG_SELECT_RUN_TO_POSITION
protected static final byte CHANNEL_MODE_FLAG_SELECT_RESET
protected static final byte[] ADDRESS_MOTOR_POWER_MAP
protected static final byte[] ADDRESS_MOTOR_MODE_MAP
protected static final byte[] ADDRESS_MOTOR_TARGET_ENCODER_VALUE_MAP
protected static final byte[] ADDRESS_MOTOR_CURRENT_ENCODER_VALUE_MAP
protected static final int iRegWindowFirst
protected static final int iRegWindowMax
protected static final byte bPowerBrake
protected static final byte bPowerFloat
protected static final byte bPowerMax
protected static final byte bPowerMin
protected static final byte cbEncoder
protected static final double apiPowerMin
protected static final double apiPowerMax
public static final int BUSY_THRESHOLD
public HiTechnicNxtDcMotorController(android.content.Context context, LegacyModule module, int physicalPort)
protected void controllerNowArmedOrPretending()
protected void doHook()
doHook
in class HiTechnicNxtController
public void initializeHardware()
initializeHardware
in class HiTechnicNxtController
protected void doUnhook()
doUnhook
in class HiTechnicNxtController
public java.lang.String getDeviceName()
public java.lang.String getConnectionInfo()
public int getVersion()
public void resetDeviceConfigurationForOpMode()
public void resetDeviceConfigurationForOpMode(int motor)
public void setMotorType(int motor, MotorConfigurationType motorType)
public MotorConfigurationType getMotorType(int motor)
public void setMotorMode(int motor, DcMotor.RunMode mode)
public DcMotor.RunMode getMotorMode(int motor)
public boolean isBusy(int motor)
public void setMotorPower(int motor, double power)
public double getMotorPower(int motor)
public void setMotorZeroPowerBehavior(int motor, DcMotor.ZeroPowerBehavior zeroPowerBehavior)
public DcMotor.ZeroPowerBehavior getMotorZeroPowerBehavior(int motor)
protected void setMotorPowerFloat(int motor)
public boolean getMotorPowerFloat(int motor)
public void setMotorTargetPosition(int motor, int position)
public int getMotorTargetPosition(int motor)
public int getMotorCurrentPosition(int motor)
protected void validateMotor(int motor)
public static DcMotor.RunMode modeFromByte(byte flag)
public static byte modeToByte(DcMotor.RunMode mode)
protected void initPID()
protected void floatHardware()
floatHardware
in class HiTechnicNxtController
public double getVoltage()