Go Down

Topic: serial interfacing (Read 668 times) previous topic - next topic

trvslamm

Hello all,
this seems very simple but being new to arduino and programming in general it is giving me a hard time. I have 3 sensors connected to analog inputs, with the arduino serial monitor i can only view one reading at a time. my question is this; is there a third party program that will take 3 inputs from the serial output of arduino and display them all on screen simultaniously?

AWOL

Quote
with the arduino serial monitor i can only view one reading at a time

You've only got one A/D converter, so it sort of makes sense that you can view one result, but I don't see why you can't print all three results.
Post your code.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

trvslamm

Code: [Select]
void setup() {
Serial.begin(9600);
}

void loop(){
digitalWrite(4, HIGH);
Serial.println(analogRead(0));//print bottom sensor value
delay(1000);//wait one second
Serial.println(analogRead(1));//print middle sensor value
delay(1000);//wait one second
Serial.println(analogRead(2));//print top sensor value
delay(1000);//wait one second
}

i see three values on the serial monitor, problem is i cant associate which value is which sensor

AWOL

Quote
problem is i cant associate which value is which sensor

Perhaps you should add a simple extra print to identify which is which.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

liudr

Serial.print("Sensor 1:");
Serial.println(analogRead(0));
...

If you want the three numbers to appear on one line, do println for the last number. That println prints info and switches to a new line.

AWOL

Or, even simpler, just print the three results on a new line.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy