public class RCXLink extends I2CSensor implements Opcode, IRTransmitter
Modifier and Type | Field and Description |
---|---|
RCXMotor |
A |
RCXMotor |
B |
static byte |
BEEP
NOTE: The BEEP macro is unreliable.
|
RCXMotor |
C |
static int |
DELAY |
static int |
EEPROM_BUFFER |
static byte |
LONG_RANGE_IR |
static byte |
MOTOR_A_FORWARD |
static byte |
MOTOR_A_REVERSED |
static byte |
MOTOR_B_FORWARD |
static byte |
MOTOR_B_REVERSED |
static byte |
MOTOR_C_FORWARD |
static byte |
MOTOR_C_REVERSED |
static byte |
POWER_OFF_RCX |
static byte |
RUN_PROGRAM_1 |
static byte |
RUN_PROGRAM_2 |
static byte |
RUN_PROGRAM_3 |
static byte |
RUN_PROGRAM_4 |
static byte |
RUN_PROGRAM_5 |
static byte |
SHORT_RANGE_IR |
static byte |
STOP_ALL_PROGRAMS |
address, DEFAULT_I2C_ADDRESS, port, REG_PRODUCT_ID, REG_VENDOR_ID, REG_VERSION, retryCount
currentMode, modes
OPCODE_ABSOLUTE_VALUE, OPCODE_ABSOLUTE_VALUE_REPLY, OPCODE_ADD_TO_VARIABLE, OPCODE_ADD_TO_VARIABLE_REPLY, OPCODE_ALIVE, OPCODE_ALIVE_REPLY, OPCODE_AND_VARIABLE, OPCODE_AND_VARIABLE_REPLY, OPCODE_BRANCH_ALWAYS_FAR, OPCODE_BRANCH_ALWAYS_NEAR, OPCODE_CALL_SUBROUTINE, OPCODE_CLEAR_MESSAGE, OPCODE_CLEAR_SENSOR_VALUE, OPCODE_CLEAR_SENSOR_VALUE_REPLY, OPCODE_CLEAR_TIMER, OPCODE_CLEAR_TIMER_REPLY, OPCODE_DATALOG_NEXT, OPCODE_DATALOG_NEXT_REPLY, OPCODE_DECREMENT_LOOP_COUNTER_FAR, OPCODE_DECREMENT_LOOP_COUNTER_NEAR, OPCODE_DELETE_ALL_SUBROUTINES, OPCODE_DELETE_ALL_SUBROUTINES_REPLY, OPCODE_DELETE_ALL_TASKS, OPCODE_DELETE_ALL_TASKS_REPLY, OPCODE_DELETE_FIRMWARE, OPCODE_DELETE_FIRMWARE_REPLY, OPCODE_DELETE_SUBROUTINE, OPCODE_DELETE_SUBROUTINE_REPLY, OPCODE_DELETE_TASK, OPCODE_DELETE_TASK_REPLY, OPCODE_DIVIDE_VARIABLE, OPCODE_DIVIDE_VARIABLE_REPLY, OPCODE_GET_BATTERY_POWER, OPCODE_GET_BATTERY_POWER_REPLY, OPCODE_GET_MEMORY_MAP, OPCODE_GET_MEMORY_MAP_REPLY, OPCODE_GET_VALUE, OPCODE_GET_VALUE_REPLY, OPCODE_GET_VERSIONS, OPCODE_GET_VERSIONS_REPLY, OPCODE_MASK, OPCODE_MULTIPLY_VARIABLE, OPCODE_MULTIPLY_VARIABLE_REPLY, OPCODE_OR_VARIABLE, OPCODE_OR_VARIABLE_REPLY, OPCODE_PLAY_SOUND_REPLY, OPCODE_PLAY_TONE, OPCODE_PLAY_TONE_REPLY, OPCODE_POWER_OFF, OPCODE_POWER_OFF_REPLY, OPCODE_REMOTE_COMMAND, OPCODE_SEND_MESSAGE, OPCODE_SET_DATALOG_SIZE, OPCODE_SET_DATALOG_SIZE_REPLY, OPCODE_SET_DISPLAY, OPCODE_SET_DISPLAY_REPLY, OPCODE_SET_LOOP_COUNTER, OPCODE_SET_MESSAGE, OPCODE_SET_MOTOR_DIRECTION, OPCODE_SET_MOTOR_DIRECTION_REPLY, OPCODE_SET_MOTOR_ON_OFF, OPCODE_SET_MOTOR_ON_OFF_REPLY, OPCODE_SET_MOTOR_POWER, OPCODE_SET_MOTOR_POWER_REPLY, OPCODE_SET_POWER_DOWN_DELAY, OPCODE_SET_POWER_DOWN_DELAY_REPLY, OPCODE_SET_PROGRAM_NUMBER, OPCODE_SET_PROGRAM_NUMBER_REPLY, OPCODE_SET_SENSOR_MODE, OPCODE_SET_SENSOR_MODE_REPLY, OPCODE_SET_SENSOR_TYPE, OPCODE_SET_SENSOR_TYPE_REPLY, OPCODE_SET_TIME, OPCODE_SET_TIME_REPLY, OPCODE_SET_TRANSMITTER_RANGE, OPCODE_SET_TRANSMITTER_RANGE_REPLY, OPCODE_SET_VARIABLE, OPCODE_SET_VARIABLE_REPLY, OPCODE_SIGN_VARIABLE, OPCODE_SIGN_VARIABLE_REPLY, OPCODE_START_FIRMWARE_DOWNLOAD, OPCODE_START_FIRMWARE_DOWNLOAD_REPLY, OPCODE_START_SUBROUTINE_DOWNLOAD, OPCODE_START_SUBROUTINE_DOWNLOAD_REPLY, OPCODE_START_TASK, OPCODE_START_TASK_DOWNLOAD, OPCODE_START_TASK_DOWNLOAD_REPLY, OPCODE_START_TASK_REPLY, OPCODE_STOP_ALL_TASKS, OPCODE_STOP_ALL_TASKS_REPLY, OPCODE_STOP_TASK, OPCODE_STOP_TASK_REPLY, OPCODE_SUBTRACT_FROM_VARIABLE, OPCODE_SUBTRACT_FROM_VARIABLE_REPLY, OPCODE_TEST_AND_BRANCH_FAR, OPCODE_TEST_AND_BRANCH_NEAR, OPCODE_TRANSFER_DATA, OPCODE_TRANSFER_DATA_REPLY, OPCODE_UNLOCK_FIRMWARE, OPCODE_UNLOCK_FIRMWARE_REPLY, OPCODE_UPLOAD_DATALOG, OPCODE_UPLOAD_DATALOG_REPLY, OPCODE_WAIT
BLACK, BLANK_INDEX, BLUE, BLUE_INDEX, BROWN, GREEN, GREEN_INDEX, MAX_TYPE, MIN_TYPE, MODE_RAW, NXT_ADC_RES, RED, RED_INDEX, TYPE_ANGLE, TYPE_COLORBLUE, TYPE_COLORFULL, TYPE_COLORGREEN, TYPE_COLORNONE, TYPE_COLORRED, TYPE_CUSTOM, TYPE_HIGHSPEED, TYPE_HIGHSPEED_9V, TYPE_HISPEED, TYPE_LIGHT_ACTIVE, TYPE_LIGHT_INACTIVE, TYPE_LOWSPEED, TYPE_LOWSPEED_9V, TYPE_NO_SENSOR, TYPE_REFLECTION, TYPE_SOUND_DB, TYPE_SOUND_DBA, TYPE_SWITCH, TYPE_TEMPERATURE, WHITE, YELLOW
Constructor and Description |
---|
RCXLink(I2CPort port) |
RCXLink(Port port) |
Modifier and Type | Method and Description |
---|---|
void |
backward(int id) |
void |
backwardStep(int id) |
void |
beep() |
int |
bytesAvailable() |
void |
defineAndRun(byte[] macro,
int len) |
void |
defineMacro(int addr,
byte[] macro) |
void |
fltMotor(int id) |
void |
flush() |
void |
forward(int id) |
void |
forwardStep(int id) |
int |
getStatus() |
void |
ping() |
void |
powerOff() |
int |
readBytes(byte[] data) |
void |
runMacro(int addr) |
void |
runProgram(int programNumber) |
void |
sendBytes(byte[] data,
int len)
Send raw bytes to the RCX
|
void |
sendF7(int msg) |
void |
sendPacket(byte[] packet)
Send a packet of data to the RCX
|
void |
sendRemoteCommand(int msg)
Send a remote control command to the RCX
|
void |
setAPDAOff() |
void |
setAPDAOn() |
void |
setDefaultSpeed() |
void |
setHighSpeed() |
void |
setMotorPower(int id,
int power) |
void |
setRangeLong() |
void |
setRangeShort() |
void |
setRawMode() |
void |
setRCXRangeLong() |
void |
setRCXRangeShort() |
void |
startMotor(int id) |
void |
stopAllPrograms() |
void |
stopMotor(int id) |
fetchString, getAddress, getData, getData, getPort, getProductID, getRetryCount, getVendorID, getVersion, sendData, sendData, sendData, setAddress, setRetryCount
fetchSample, getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, getName, sampleSize, setCurrentMode, setCurrentMode, setModes
close, releaseOnClose
public RCXMotor A
public RCXMotor B
public RCXMotor C
public static final byte SHORT_RANGE_IR
public static final byte LONG_RANGE_IR
public static final byte POWER_OFF_RCX
public static final byte RUN_PROGRAM_1
public static final byte RUN_PROGRAM_2
public static final byte RUN_PROGRAM_3
public static final byte RUN_PROGRAM_4
public static final byte RUN_PROGRAM_5
public static final byte STOP_ALL_PROGRAMS
public static final byte MOTOR_A_FORWARD
public static final byte MOTOR_A_REVERSED
public static final byte MOTOR_B_FORWARD
public static final byte MOTOR_B_REVERSED
public static final byte MOTOR_C_FORWARD
public static final byte MOTOR_C_REVERSED
public static final byte BEEP
public static final int EEPROM_BUFFER
public static final int DELAY
public void runMacro(int addr)
public void beep()
beep
in interface IRTransmitter
public void runProgram(int programNumber)
runProgram
in interface IRTransmitter
public void forwardStep(int id)
forwardStep
in interface IRTransmitter
public void backwardStep(int id)
backwardStep
in interface IRTransmitter
public void setRCXRangeShort()
public void setRCXRangeLong()
public void powerOff()
public void stopAllPrograms()
stopAllPrograms
in interface IRTransmitter
public void flush()
public void setDefaultSpeed()
public void setHighSpeed()
public void setRangeLong()
public void setRangeShort()
public void setAPDAOn()
public void setAPDAOff()
public void defineMacro(int addr, byte[] macro)
public int getStatus()
public int bytesAvailable()
public void ping()
public void sendF7(int msg)
public void sendPacket(byte[] packet)
IRTransmitter
sendPacket
in interface IRTransmitter
public void sendRemoteCommand(int msg)
IRTransmitter
sendRemoteCommand
in interface IRTransmitter
msg
- the code for the remote commandpublic void setMotorPower(int id, int power)
public void stopMotor(int id)
public void startMotor(int id)
public void fltMotor(int id)
public void forward(int id)
public void backward(int id)
public void setRawMode()
public void sendBytes(byte[] data, int len)
IRTransmitter
sendBytes
in interface IRTransmitter
data
- the raw datalen
- the number of bytespublic int readBytes(byte[] data)
public void defineAndRun(byte[] macro, int len)