Using RCXPort

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

Moderator: roger

Using RCXPort

Postby jvance » Wed Jan 02, 2008 4:59 pm

Hi everyone,
I am testing RCXPort, but I am having some probelms. I have a simple program which compiles and downloads fine to the RCX:
Code: Select all
import josx.rcxcomm.*;
import java.io.*;
import josx.platform.rcx.*;
public class Receiver {
   public static void main(String args[]){
      try{
         RCXPort port = new RCXPort();
         InputStream is = port.getInputStream();
         DataInputStream dis = new DataInputStream(is);
         int i = dis.read();
         LCD.showNumber(i);
         Thread.sleep(4000);
      }
      catch(Exception e){}
   }
}


This code compiles, downloads, and runs fine on the RCX.
I also have the "Sending" code for the PC.
Code: Select all
    import josx.rcxcomm.*;
    import java.io.*;

    public class Send {

      public static void main(String [] args) {

        try {
          RCXPort port = new RCXPort();

          OutputStream os = port.getOutputStream();
   DataOutputStream dos = new DataOutputStream(os);

          dos.write((int)1);
          dos.flush();
        }
        catch (IOException ioe) {
         
        }
   }
    }

This code also compiles as well, but when I run it I get this message.

C:\>java Send
Exception in thread "main" java.lang.UnsatisfiedLinkError: josx.rcxcomm.LLC.init
()V
at josx.rcxcomm.LLC.init(Native Method)
at josx.rcxcomm.LLCHandler.<init>(LLCHandler.java:18)
at josx.rcxcomm.RCXPort.<init>(RCXPort.java:18)
at Send.main(Send.java:9)

C:\>

The irtower.dll file is not in the bin directory of the final lejos version, so I downloaded an old version of lejos (lejos_win32_1_0_5) got the dll and put it into the bin version of the lejo distro I was using. I still get this message. What is going on? By the way, I can compile and run non lejos java programs fine.
Any help thanks.
V
jvance
New User
 
Posts: 22
Joined: Sun Aug 12, 2007 2:22 am

Postby jvance » Wed Jan 02, 2008 7:55 pm

Since I posted, I tried out the
RCXPort port = new RCXPort(args[0]);
instead of
RCXPort port = new RCXPort();
but the compiler says it can't resolve the constructor with a String argument.
I don't understand it.
Help me! Please!
V
jvance
New User
 
Posts: 22
Joined: Sun Aug 12, 2007 2:22 am

Postby mdsmitty » Thu Jan 03, 2008 2:05 am

Take a look at the in and out stream samples under the comm folder.
mdsmitty
Novice
 
Posts: 78
Joined: Tue Feb 27, 2007 3:07 am

Postby jvance » Mon Jan 07, 2008 9:03 pm

Ok, I will look, but I think I already did that.
jvance
New User
 
Posts: 22
Joined: Sun Aug 12, 2007 2:22 am


Return to RCX Software

Who is online

Users browsing this forum: No registered users and 1 guest

cron
more stuff