|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object icommand.nxt.I2CSensor icommand.nxt.RCXLink
public class RCXLink
NRLink by Mindsensors.com is a bridge between NXT and RCX bricks. The adapter allows the NXT to control the motors on an RCX brick (not sensors) via the IR port on the RCX. e.g. RCXLink rcx = new RCXLink(Port.S1); rcx.A.forward();
Nested Class Summary | |
---|---|
class |
RCXLink.Motor
|
Fields inherited from class icommand.nxt.I2CSensor |
---|
DEFAULT_ADDRESS, PRODUCT_ID, SENSOR_TYPE, STOP, VERSION |
Constructor Summary | |
---|---|
RCXLink(SensorPort s)
Initializes the RCXLink. |
Method Summary | |
---|---|
void |
beep()
Makes the RCX chirp. |
void |
flush()
Flush the FIFO (First In First Out) buffer |
protected byte[] |
getData(byte register,
int length)
Override method because of unreliability retrieving more than a single byte at a time with some I2C Sensors (bug in Lego firmware). |
byte[] |
getMacroData()
Test method to retrieve macro data. |
void |
powerOff()
Sends command to turn off the RCX brick. |
void |
runMacro(byte macro)
Run the ROM/EEPROM macro at address 0xXX |
void |
runProgram(int programNumber)
Runs a program on the RCX. |
void |
sendMacro(byte[] macroCommands)
Transmit Unassembled raw macro data. |
void |
setHighSpeed(boolean highspeed)
Sets the communications speed of the RCXLink. |
void |
setLongRange(boolean longrange)
Sets the range of the IR light on the RCXLink. |
void |
stopAllPrograms()
Stops any currently executing programs on the RCX. |
Methods inherited from class icommand.nxt.I2CSensor |
---|
fetchString, getData, getId, getProductID, getSensorType, getVersion, sendData, sendData |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public RCXLink.Motor A
public RCXLink.Motor B
public RCXLink.Motor 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 byte EPROM_MOTOR_A_ON
public static final byte EPROM_MOTOR_A_FORWARD
public static final byte EPROM_MOTOR_A_REVERSED
public static final byte EPROM_MOTOR_A_FLIP_DIRECTION
public static final byte EPROM_MOTOR_A_OFF
public static final byte EPROM_MOTOR_B_ON
public static final byte EPROM_MOTOR_B_FORWARD
public static final byte EPROM_MOTOR_B_REVERSED
public static final byte EPROM_MOTOR_B_FLIP_DIRECTION
public static final byte EPROM_MOTOR_B_OFF
public static final byte EPROM_MOTOR_C_ON
public static final byte EPROM_MOTOR_C_FORWARD
public static final byte EPROM_MOTOR_C_REVERSED
public static final byte EPROM_MOTOR_C_FLIP_DIRECTION
public static final byte EPROM_MOTOR_C_OFF
public static final byte EPROM_GET_BATTERY_POWER
Constructor Detail |
---|
public RCXLink(SensorPort s)
Method Detail |
---|
public void runProgram(int programNumber)
programNumber
- 1-5public void stopAllPrograms()
public void powerOff()
public void beep()
public void setLongRange(boolean longrange)
longrange
- true = long range, false = short rangepublic void setHighSpeed(boolean highspeed)
highspeed
- true = 4800 baud, false = 2400 baud (default)public void sendMacro(byte[] macroCommands)
public void runMacro(byte macro)
public void flush()
public byte[] getMacroData()
protected byte[] getData(byte register, int length)
getData
in class I2CSensor
register
- e.g. FACTORY_SCALE_DIVISOR, BYTE0, etc....length
- Length of data to read (minimum 1, maximum 16)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |