Pages: [1]   Go Down
Author Topic: serial interfacing  (Read 511 times)
0 Members and 1 Guest are viewing this topic.
NC,US
Offline Offline
Newbie
*
Karma: 0
Posts: 42
@Weedar_64 #Farmlife
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 301
Posts: 26242
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

"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.

NC,US
Offline Offline
Newbie
*
Karma: 0
Posts: 42
@Weedar_64 #Farmlife
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
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
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 301
Posts: 26242
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
problem is i cant associate which value is which sensor
Perhaps you should add a simple extra print to identify which is which.
Logged

"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.

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 73
Posts: 7189
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 301
Posts: 26242
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Or, even simpler, just print the three results on a new line.
Logged

"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.

Pages: [1]   Go Up
Jump to: