public class IRLink extends I2CSensor implements Opcode, IRTransmitter
Modifier and Type | Field and Description |
---|---|
static byte |
PF_BACKWARD |
static byte |
PF_BRAKE |
static byte |
PF_FLOAT |
static byte |
PF_FORWARD |
static byte |
PF_MODE_COMBO_DIRECT |
static int |
RCX_REMOTE_A_BWD |
static int |
RCX_REMOTE_A_FWD |
static int |
RCX_REMOTE_B_BWD |
static int |
RCX_REMOTE_B_FWD |
static int |
RCX_REMOTE_BEEP |
static int |
RCX_REMOTE_C_BWD |
static int |
RCX_REMOTE_C_FWD |
static int |
RCX_REMOTE_MSG1 |
static int |
RCX_REMOTE_MSG2 |
static int |
RCX_REMOTE_MSG3 |
static int |
RCX_REMOTE_P1 |
static int |
RCX_REMOTE_P2 |
static int |
RCX_REMOTE_P3 |
static int |
RCX_REMOTE_P4 |
static int |
RCX_REMOTE_P5 |
static int |
RCX_REMOTE_STOP |
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
Modifier and Type | Method and Description |
---|---|
void |
backwardStep(int motor) |
void |
beep() |
void |
forwardStep(int motor) |
void |
runProgram(int programNumber) |
void |
sendBytes(byte[] data,
int len)
Send raw bytes to the RCX
|
void |
sendPacket(byte[] data)
Send a packet of data to the RCX
|
void |
sendPFComboDirect(int channel,
int opA,
int opB)
Send commands to both motors.
|
void |
sendRemoteCommand(int msg)
Send a remote control command to the RCX
|
void |
stopAllPrograms() |
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 static final byte PF_MODE_COMBO_DIRECT
public static final byte PF_FLOAT
public static final byte PF_FORWARD
public static final byte PF_BACKWARD
public static final byte PF_BRAKE
public static int RCX_REMOTE_BEEP
public static int RCX_REMOTE_STOP
public static int RCX_REMOTE_P5
public static int RCX_REMOTE_P4
public static int RCX_REMOTE_P3
public static int RCX_REMOTE_P2
public static int RCX_REMOTE_P1
public static int RCX_REMOTE_C_BWD
public static int RCX_REMOTE_B_BWD
public static int RCX_REMOTE_A_BWD
public static int RCX_REMOTE_C_FWD
public static int RCX_REMOTE_B_FWD
public static int RCX_REMOTE_A_FWD
public static int RCX_REMOTE_MSG3
public static int RCX_REMOTE_MSG2
public static int RCX_REMOTE_MSG1
public void sendPFComboDirect(int channel, int opA, int opB)
channel
- the channel number (0-3)opA
- Motor A operationopB
- Motor B operationpublic void sendBytes(byte[] data, int len)
IRTransmitter
sendBytes
in interface IRTransmitter
data
- the raw datalen
- the number of bytespublic void sendPacket(byte[] data)
IRTransmitter
sendPacket
in interface IRTransmitter
public void sendRemoteCommand(int msg)
IRTransmitter
sendRemoteCommand
in interface IRTransmitter
msg
- the code for the remote commandpublic void runProgram(int programNumber)
runProgram
in interface IRTransmitter
public void beep()
beep
in interface IRTransmitter
public void stopAllPrograms()
stopAllPrograms
in interface IRTransmitter
public void forwardStep(int motor)
forwardStep
in interface IRTransmitter
public void backwardStep(int motor)
backwardStep
in interface IRTransmitter