Even though I'm kinda new to Arduino, I'm a bit ashamed to ask something simple as USB communication here. Especially because there are loads of tutorials to be found online (even on the arduino.cc homepage)
But still... I haven't been able to get it to work =/
Just for starters, I want to have my arduino to send numbers/words to the PC, and read it in Java.
Anyone have a good tutorial for that? one that does include Java example code?
Serial.print("<"); // Send a start marker
Serial.print("Some words");
Serial.print(",");
Serial.print(someVariable);
Serial.print(",");
Serial.print(anotherVariable);
Serial.print(">"); // Send an end marker
Then, the Java applications needs to append characters to the string, starting when it sees the <, and stopping when it sees the >. Use the data only after you see a >.
He meant that he wants with the Arduino via serial port using Java as the in-between-er to fetch and send the data over the serial port to the Arduino. That, sir, can be done. He does not want to run Java code on the Arduino. He says:
I want to have my arduino to send numbers/words to the PC, and read it in Java