As the subject states, I want to print three variables one line on the serial monitor and then have them print again on a new line after.
This is my code
int pin, pin1, pin2;
void setup() {
Serial.begin(9600);
pinMode(A0, INPUT);
pinMode(A1, INPUT);
pinMode(A2, INPUT);
}
}
void loop() {
pin = analogRead(A0);
pin1 = analogRead(A1);
pin2 = analogRead(A2);
Serial.println(pin + pin1 + pin2);
}
The serial monitor displays the sum of all three variables (pin + pin1 + pin2) instead I want them to be displayed separately (pin1, pin2, pin3)
I tried to use Serial.println(pin, pin1, pin2); but that gave me this error:
exit status 1
no matching function for call to 'UARTClass::println(int&, int&, int&)'
system
2
The serial monitor displays the sum of all three variables (pin + pin1 + pin2) instead I want them to be displayed separately (pin1, pin2, pin3)
Why are you ADDING the values? It doesn't seem to difficult to figure out that you need to print them using separate calls to Serial.println().
Serial.print(pin);
Serial.print(pin1);
Serial.println(pin2)
system
4
marco_c:
Serial.print(pin);
Serial.print(pin1);
Serial.println(pin2)
The problem with that is what does
1394578
mean?
Why not add the values, as do Frank and Earnest?

True, good catch Paul. You need to add a space between them 
Just more printing.
wg0z
7
try this :
Serial.print(pin); Serial.print(" ");
Serial.print(pin1); Serial.print(" ");
Serial.println(pin2)