Send multiple labelled variables from Processing on keystroke

Hello,

I am relatively new to Arduino and Processing and would very much appreciate your help with the following.

I have three variables in Processing; A, B and C. I have three variables in my Arduino programme; X, Y and Z. I would like to achieve the following:

On pressing A on my PC keyboard, via serial I would like to send variable A to the Arduino and update variable X so as to equal variable A. I would like to do the same for B and C respectively.

I do not want to send a constant stream of data over serial, only when a key is pressed.

I searched for the answer to this but can only find threads relating to sending just one variable or constantly sending multiple sensor readings.

Thank you in advance.

I don't know Processing but the examples in serial input basics should be useful for your Arduino code

...R

Robin,

Thanks for pointing me to your brilliant serial tutorial. As you rightly say, there are lots of other tutorials out there but I got swamped in unnecessary functions etc. I have now solved my problem by sending strings packaged with start and end markers with the first character labelling where the incoming data should be sent. I'm sure it's not the prettiest or most efficient coding, but it works!