ArduinoComm
Updated: 11 April 2010 - code significantly simplified. No need to have identifiers for each value any more.
ArduinoComm is used for all the basic sensor setups as the first step on the computer side to read the data coming in from the arduino and output it to terminal for viewing, The added advantage over using the arduino serial monitor is that you can output the data with ease to a file for logging or live graphing using kst.
How it works
ArduinoComm simply reads in data sent from the Arduino and prints it to the terminal window.
The main thing to note is that it read's in lines and so say you want to print out realPower, ApparentPower and powerFactor typically the arduino code would look like this.
Serial.print(realPower);
Serial.print(' ');
Serial.print(apparentPower);
Serial.print(' ');
Serial .println(powerFactor);
Note that the last line is a Serial.println
Running ArduinoComm
- Download the ArduinoComm java program here.
- Unzip ArduinoComm.tar.gz
- Compile the program by typing $ javac *.java
- Run the program with $ java Program
For a 'How to' on compiling and running java programs have a look here. (It also details installation of rxtx library)
You should now see lines of values appear in your terminal window, looking something like the screenshot above.
You can then write these values to a file by running the program with $ java Program >filename.dat

This file can then be opened in real time by KST for graphing which is detailed here.