Low Level IR Communication

This is where you talk about the RCX software itself, installation issues, and programming talk.

Moderator: roger

New User
Posts: 16
Joined: Fri Feb 09, 2007 5:08 pm

Low Level IR Communication

Postby stevendh » Wed Feb 21, 2007 4:53 pm

Hello all.

For those of you who don't know, I am currently doing a project at the University of Washington dealing with RCX communication. I need to be able to send an opcode from one RCX with lejos firmware to another RCX with any given firmware (most likely legOS or default firmware). This opcode will tell the other RCX to delete firmware, play a sound, move a motor, etc.

There are two classes I've seen in the Lejos API, LLC.class (low level comms) and serial.class.

Which one should I use, or will both work? I am currently programming with the serial class, but I have not tested it yet to see if another RCX can receive the message I am sending. Most of my knowledge is based off of the RCX Internals website, but any help would be greatly appreciated!

Here is the comms part of the code so far...

public static final byte OPCODE_DELETE_FIRMWARE = (byte)0x65;
protected void sendByte()
byte packet[] = new byte[9];
// pack the bits
packet[0] = (byte)0x55;
packet[1] = (byte)0xFF;
packet[2] = (byte)0x00;
packet[3] = (byte)0xF7;
packet[4] = (byte)0x08;
packet[5] = (byte)OPCODE_DELETE_FIRMWARE;
packet[6] = (byte)0x1A;
packet[7] = (byte)0xFA;
packet[8] = (byte)0x05;
josx.platform.rcx.Serial.sendPacket(packet, 0, 9);

According to the RCX Internals website, I know you need to send the opcode header 55 FF 00, then the message, than the checksum.

Steven Hansen
University of Washington
P.S. Sorry for the big post!

Return to “RCX Software”

Who is online

Users browsing this forum: No registered users and 0 guests