user3045: I would like to send information between my Arduino and my computer. Is there a way to send multiple variables from one Arduino? If so, how would I go about separating the variables?

user220: You have three options for what you want to achieve (if I understand it right):

Have a fixed length for each variable: If I know each number is going to be two digits, I can send "1234" and the other side can figure out the numbers are "12" and "34".
Have a delimiter character: Have a character that signals a new variable. For example: "213|1234" would translate into "213" and "1234". You could even use the newline character to signal a new line (with Serial.println();).
Do some sort of validation to separate the data: If sending a favorite number and favorite color, I can send "12RED345BLUE" and the other side it can find that it's "12" (both numbers), then "RED" (all letters), then "345" (three numbers), and finally "BLUE" (again, all letters).


3045: <p>I would like to send information between my Arduino and my computer. Is there a way to send multiple variables from one Arduino? If so, how would I go about separating the variables?</p>
 220: <p><strong>You have three options for what you want to achieve (if I understand it right):</strong></p>

<ul>
<li><strong>Have a fixed length for each variable:</strong> If I know each number is going to be two digits, I can send "1234" and the other side can figure out the numbers are "12" and "34".</li>
<li><strong>Have a delimiter character:</strong> Have a character that signals a new variable. For example: "213|1234" would translate into "213" and "1234". You could even use the newline character to signal a new line (with <code>Serial.println();</code>).</li>
<li><strong>Do some sort of validation to separate the data:</strong> If sending a favorite number and favorite color, I can send "12RED345BLUE" and the other side it can find that it's "12" (both numbers), then "RED" (all letters), then "345" (three numbers), and finally "BLUE" (again, all letters).</li>
</ul>
