I am running a arduino uno which generates a serial data stream (via USB). This is read by a processing application to visualize the data. Seperately I have developed a max/msp patch which generates a MIDI sound stream based on the same arduino output. The problem is that I would like to run both these apps at the same time, and use the same data. Both Applications would have to read the same COM port (no writing is needed). Is there any way I can do this without thinking of rewriting the programmes, i.e by something like a COM port emulator / data cloner etc. Under normal circumstances, once an app opens the port, no other application can lock onto it.
Thanks in advance!
Well obviously both programs have to be capable of running in the same Arduino (i.e. you have enough space for both, you use different named global variables and functions, etc.
I could imagine writing your own class FakeSerial (or some such) that provides the Serial functions you use for input. One of the FakeSerial is the master, and is assumed to always read the input first. The master FakeSerial then reads from the normal Serial, stores the data read in a hidden buffer, and then returns it. The slave FakeSerial would then look at the hidden buffer, and return information from it. You would use the standard Serial for output.