![]() ![]() If (event.getEventType() = SerialPortEvent. Public void serialEvent(SerialPortEvent event) Unfortunatly Serial-Comm suffers from two problems that I can't overcome: 1) It cannot give an up to date list of COM ports, e.g. Here is the part of the code that is giving me problems: static int baudrate = 9600, So far I've tried RXTX and Serial-Comm, both of them are very good, RXTX has tons of functionality, Serial-Comm is very light, easy to use and platform independent. I've been messing with various things but I haven't been able to fix the problem. I'm thinking it's a timing problem, because when I manually go through the code using the debugger, the result string is always what it should be: one 20 byte string. The output of my Java program may look something like: Number of Bytes: 15 If the string is long (>10 bytes or so) the output will get broken up. The other one is called SerialCom and shall connect to the. I have two seperate JAVA classes: one is called window it manages the view and adds some sliders and so on. My Java program should print the number of bytes that have been read and then print out the contents. I recently tried to create an application that can send code via the serial port to my arduino. The code is based on the Java SimpleRead.Java found here.Ĭurrently the Arduino simply prints out a string when it starts up. The Arduino is actually connected to the PC using an FTDI cable. I'm trying to communicate between my PC (Windows 7 using Netbeans and RXTX) with an Arduino Pro, using the serial port.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |