I need to write Simple JAVA program to read and write from USB serialto use it with Arduino

Discussion in 'Java' started by sahm, Oct 13, 2012.

  1. sahm

    sahm Guest

    Hi every one

    I’m trying to write simple JAVA program that could send command to Arduino board or read output from Arduino.
    I tried java-simple-serial-connector library but I keep getting error.
    And in Arduino web site they use gnu.io. classpath witch I have no idea howto use it with java

    Please help me

    Best
    Salim
    sahm, Oct 13, 2012
    #1
    1. Advertising

  2. sahm

    Lew Guest

    Re: I need to write Simple JAVA program to read and write from USBserial to use it with Arduino

    sahm wrote:
    > I’m trying to write simple JAVA [sic] program that could send command to
    > Arduino board or read output from Arduino.
    > I tried java-simple-serial-connector library but I keep getting error.
    > And in Arduino web site they use gnu.io. classpath


    It's not a classpath.

    > witch I have no idea how to use it with java [sic]


    I can answer only part of this. To use any library with a Java program,
    typically one has that library in the form of a JAR file (file with name
    ending in ".jar", in ZIP file format and possessing certain contents; GIYF)
    that one includes in the classpath (GIYF).

    There are also language requirements to using libraries involving the 'import'
    directive. (TIYF: The Tutorial is Your Friend.)

    Download the library you need and include it in your classpath.

    Follow up here with the specific commands you use, exactly how you use them,
    and copied and pasted output if you need further help. Make sure you do the
    suggested research first.

    --
    Lew
    Lew, Oct 13, 2012
    #2
    1. Advertising

  3. sahm

    Arne Vajhoej Guest

    Re: I need to write Simple JAVA program to read and write from USBserial to use it with Arduino

    On 10/13/2012 3:54 PM, sahm wrote:
    > I’m trying to write simple JAVA program that could send command to Arduino board or read output from Arduino.
    > I tried java-simple-serial-connector library but I keep getting error.
    > And in Arduino web site they use gnu.io. classpath witch I have no idea how to use it with java


    Serial port support has not been a priority in Java.

    I believe the most common recommendation is to go for rxtx.

    Arne
    Arne Vajhoej, Oct 14, 2012
    #3
  4. Re: I need to write Simple JAVA program to read and write from USBserial to use it with Arduino

    On 10/13/2012 12:54 PM, sahm wrote:
    > Hi every one
    >
    > I’m trying to write simple JAVA program that could send command to Arduino board or read output from Arduino.
    > I tried java-simple-serial-connector library but I keep getting error.
    > And in Arduino web site they use gnu.io. classpath witch I have no idea how to use it with java
    >
    > Please help me
    >
    > Best
    > Salim
    >


    On Windows, if you only need to read and write, you can do that with the
    COM? port. If you need access to the serial data lines you need to find
    an old copy of the JavaComm API. I'm using it with Windows XP, I think
    it would work with Vista or 7 but I've never tried it. It is no longer
    supported by Oracle(Sun) but you can find it if you snoop around. Last
    time I checked, there was still a version available from Sun for Linux I
    think.

    I tried RXTX once but it was too buggy to use and there was no interest
    in fixing it.

    --

    Knute Johnson
    Knute Johnson, Oct 14, 2012
    #4
  5. sahm

    Guest

    Re: I need to write Simple JAVA program to read and write from USBserial to use it with Arduino

    On Saturday, October 13, 2012 1:54:48 PM UTC-6, sahm wrote:
    > Hi every one I’m trying to write simple JAVA program that could send command to Arduino board or read output from Arduino. I tried java-simple-serial-connector library but I keep getting error. And in Arduino web site they use gnu.io. classpath witch I have no idea how to use it with java Pleasehelp me Best Salim


    We have had good success with SerialPort from SerialIO.com. It has worked well for a several different serial devices.

    John
    , Oct 15, 2012
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. galapogos
    Replies:
    4
    Views:
    345
    Kenny McCormack
    May 11, 2007
  2. LittleAlex
    Replies:
    0
    Views:
    400
    LittleAlex
    Sep 15, 2008
  3. Etantonio
    Replies:
    5
    Views:
    1,503
    Sebastian Millies
    Dec 12, 2008
  4. Ivan Shmakov

    the Arduino language?

    Ivan Shmakov, Mar 20, 2013, in forum: C Programming
    Replies:
    6
    Views:
    315
    Theo Markettos
    Mar 27, 2013
  5. Thomas
    Replies:
    5
    Views:
    73
Loading...

Share This Page