smikis:
But you should be able to have communication between processing and arduino, its not exactly new, there are plenty of examples online (not that they help me here).
Yes, you can have communication between Processing and Arduino.
Now I cannot compile arduino sketch if processing sketch is running,
Yes you can. You cannot, however, upload a sketch if Processing has the COM port open. You can only have ONE program accessing the COM port at any given time.
if processing sketch isn't running I can compile arduino sketch, but I cant do both at the same time.
That's right. only ONE program can be using the COM port. The Arduino IDE needs the COM port to upload your Arduino sketch. If Processing is running, the IDE is prevented by the Operating system from opening the COM port, because it is already opened by Processing.
There must be something obvious I am missing that would allow processing communicate with arduino using serial port.
There is something obvious you are missing, and that is that ONLY ONE PROGRAM AT A TIME CAN OPEN ANY GIVEN COM PORT.
I mean there are arduino examples for serial port communications ( they dont work for me as well )
Yes, of course there are, but there are no examples that show you how to upload an Arduino sketch at the same time that another program has the COM port open.
You want to upload a sketch? Close the COM port. If you can do that with Processing still running, fine (I'm not familiar with Processing, so I don't know if that's possible). But if you can't close the COM port and have Processing still running, then you'll need to close Processing to upload your sketch. Only then can you open the COM port with another program.
Processing is just one such program. You can also use the IDE's Serial Monitor, and if it's opened by the same instance of the IDE that you are uploading a sketch from, the IDE will close the Serial Monitor in order to upload the Arduino sketch. If a Serial Monitor is opened by another instance of the IDE, the upload will fail, because the uploading IDE instance does not know how to close the Serial Monitor because it didn't run it.
You can also use a terminal program to communicate with the Arduino, but while the terminal program has the Arduino's COM port open, you will not be able to upload a sketch.
I don't know how I can make it any clearer. Upload sketches work only when the COM port is NOT open in another program. Period.