Hi all,
I am having an issue with the Serial library that comes built into Arduino (from Processing). My project is attempting to communicate with the Arduino from a custom Java application. I have a simple Serial.write(Serial.read()) loop going on on the Arduino to test.
I am using the Serial.java and friends (Exceptions and MessageConsumer) that come packaged with Arduino. I have traced the issue down to the following: it works when debugging only. I have also traced the problem down to the particular line that does not work when running normally. It appears to be the output.write(bytes) line from Serial.java:
public void write(byte bytes[]) {
try {
output.write(bytes);
output.flush(); // hmm, not sure if a good idea
} catch (Exception e) { // null pointer or serial port dead
//errorMessage("write", e);
e.printStackTrace();
}
}
I notice that when I am debugging, my MessageConsumer's message() method gets called as soon as this line executes, but in a normal run that function never gets called. I have already put many hours into this and appear to be at a wall. Any hints/ideas are very appreciated. Thanks, John