Hi all,
I have been struggling for a while now with using events to receive a string from a serial port and using the data inside my main function.

To set a bit of context i am sending movements for a buggy to follow and when a movement is complete, the buggy returns a "D". When the program receives this, the next coordinate should be sent.

I'm sure there is a tidy way of doing this avoiding global variables and i would very much appreciate it if someone with more knowledge in this area could lend a hand.

Code available on request.

Thanks in advance, Chris Augier.