Hi everybody,
i've got a strange behaviour with analog inputs: on software side i'm using 2 analog inputs, but on hardware side, i only plug one.
Now, i expected that the arduino would give me correct values on the pin, that does have a sensor plugged - and weird values on the other one.
But no! I'm getting the same vlaue for both pins. Even so, that one pin doesn't have any sensor plugged, it gives back similar values as the pin that does have a value (using a sharp distance sensor).
Isn't that strange? Or am I doing sth wrong?
(Tested with Arduino Mega and Arduino Nano)
int pin1 = 1;
int pin7 = 4;
void setup() {
Serial.begin(9600);
}
void loop() {
float in1 = analogRead(pin1)*0.0048828125;
float in7 = analogRead(pin7)*0.0048828125;
Serial.print("[");
Serial.print(in1);
Serial.print(":");
Serial.print(in7);
Serial.print("]");
delay(10);
}