Java IDE and Adruino communication problem

Is there a way round having to manually reset the Adruino mega after starting serial communication with the board. when my project is completed i wont have access to the board as it will be in a remote location, so this is going to be an issue. can someone please provide a quick fix example that will work by either responding to a command from a PC or internally in the setup code. cheers J.

Is there a way round having to manually reset the Adruino mega after starting serial communication with the board.

Unless you have modified the Arduino, opening the serial port from a PC application does reset the Arduino.

when my project is completed i wont have access to the board as it will be in a remote location, so this is going to be an issue.

But still connected to a PC?

can someone please provide a quick fix example that will work by either responding to a command from a PC or internally in the setup code.

What you are describing is not normal behavior. Until the sketch is running, any code in setup() won't be executed, including connecting to the serial port to receive a command. So, no, code won't help you.

Hi Paul, The board will still be connected to the PC, It might not actually be a huge issue as the board will be powered up the same time as the PC (a PC104 in the case of my project) so it will probbably have started up by the time the application on the PC starts to interogate the Adruino. however when the board starts up digital O/P 13 comes on and stays on without a reset, im using it to drive a relay in my application and on at start up is undisirable. i can fudge my hardware to overcome this but was interested to know if there was somthing i could have done to get the board to work the way i want it. I have written into the code to send 0 output to pin 13 after configuring the port in set up, i expect to get my knuckles cracked for not doing things properly but it works...

however when the board starts up digital O/P 13 comes on and stays on without a reset, im using it to drive a relay in my application and on at start up is undisirable.

Pin 13 has the onboard LED. It may be set to OUTPUT by default, rather than INPUT like the other pins.

I have written into the code to send 0 output to pin 13 after configuring the port in set up, i expect to get my knuckles cracked for not doing things properly but it works...

That is the proper way of setting the pin state and mode to the way you want it. No knuckle rapping in your future. Not over this, anyway.