Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Java jar programme with a microcontroller

  1. #1
    Member
    Join Date
    Mar 2011
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Java jar programme with a microcontroller

    hi.. i am required to write a java programme to get input from the micro controller thru its SCI port... the SCI port would be connected to my PC's COM1... i would like to check in my java programme how do i write the connection statement or codes to get the input from the microcontroller?? the programme will be using JPanel/JFrame...


  2. #2
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default Re: Java jar programme with a microcontroller

    You'll probably be using RXTX then? Does your PC have a COM1? That's a serial port on a Microsoft operating system, right? None of my PCs have serial ports - I use USB serial adapters. They're not expensive, but not everywhere has them.

  3. #3
    Member
    Join Date
    Mar 2011
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Java jar programme with a microcontroller

    Quote Originally Posted by Sean4u View Post
    You'll probably be using RXTX then? Does your PC have a COM1? That's a serial port on a Microsoft operating system, right? None of my PCs have serial ports - I use USB serial adapters. They're not expensive, but not everywhere has them.
    my com has serial port.. and sorry for nt mentioning that this is a school project... so i have to stick with serial... do u happen to have the java code to get the inputs from the serial ports??

  4. #4
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default Re: Java jar programme with a microcontroller

    do u happen to have the java code ...?
    Somewhere between the javax.comm packages and the RXTX project there's a collection of demo projects - it should be in with the rest of the sources / classes / libs you'll need to connect to your serial port. Make sure you compile all the demo projects and run them to understand how Java / serial port works. Once you have the demo projects working on your serial port, just look in the source for the fragment of code that does what you want and copy it from there. Remember to include adequate attribution in your comments and any reports you write.

    If you don't have access to a working microcontroller yet, you can practice your Java serial programming by finding an old modem with a serial port on it, or a mobile phone with a PC cable (even many USB phone cable connections - particularly older ones - still create a kind of virtual serial port on the PC) may also work. That way you can send Hayes (AT) commands from your Java program and capture the responses from the modem/cellphone.

Similar Threads

  1. [SOLVED] I have a problem with this Joption programme.
    By Leprechaun_hunter in forum What's Wrong With My Code?
    Replies: 7
    Last Post: April 12th, 2011, 03:31 AM
  2. While loop crashing my programme?
    By livewires in forum What's Wrong With My Code?
    Replies: 0
    Last Post: March 19th, 2011, 12:36 PM
  3. help with bookfinder programme
    By kidza12 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: February 9th, 2011, 02:15 PM
  4. Simple Programme for Date
    By bhavinsparikh in forum Java Theory & Questions
    Replies: 1
    Last Post: August 28th, 2010, 07:24 AM
  5. access cisco router with java programme
    By vigneswara in forum Java Theory & Questions
    Replies: 1
    Last Post: May 11th, 2010, 01:36 AM