Thursday, March 5, 2009

Tattoo Ideas For Skinny Guys

Serial Communication in Java


young druggies Hello, in this post we will talk about a very interesting topic that can be quite useful for many of you. We refer to the serial communication using JAVA programming language. At the entrance

"MIDI naked (Part 3) " define the communication between the microcontroller interface and robot master would serially. This is mainly due to the ease and simplicity of operation compared to the USB protocol.

is true that we are using a USB-Serial adapter , but for the computer that is transparent, ie, the machine is an adapter cable ordinary COM port.

Having said that, let's the interesting part. How to manipulate the flow of data through a COM port using Java? Well, first of all we must install a few libraries that can be found in www.rxtx.org

rxtxSerial Installation (www.rxtx.org) in Linux

Lower package rxtx-2.1-7 -bins-r2.zip (Final) "
librxtxSerial.so copy to / usr / lib
RXTXcomm.jar copy to [JDK-directory] / jre / lib / ext /

rxtxSerial Installation ( www.rxtx.org) in Windows

Lower package rxtx-2.1-7-bins-r2.zip (Final) "
rxtxSerial.dll copy to [JDK-directory] \\ jre \\ bin \\ rxtxSerial.dll
RXTXcomm.jar copy to [JDK-directory] \\ jre \\ lib \\ ext \\ RXTXcomm.jar

And that's it, now I just have to make sure you add the appropriate Imports to the top of its agenda. We recommend you visit the wiki RXTX project, there are a lot of information with many examples and projects to download.

Here is the example on which we rely to jump-start our user interface. This Java program shows how to write the classic "Hello World" on serial port . Remember that both a Java compiler RXTX libraries must be installed on your computer to make this application work.

No comments:

Post a Comment