Yes, I used the above program on my Arduino Uno R3. (It's so basic there can't be anything wrong with it.) I disabled the measurement (and transmission) of A1 and A2 in my program, and increased the delay to 1 second. I connected a simple voltage divider to A0 (2 resistors:, 1K from 5V pin on top of a 2.2K resistor to GND) If I consider the voltage on the Aref pin (the analog reference value which would result in 1023), then the middle point of the 2 resistors neatly results in the right ADC value.
Code: Select allvoid setup() {
Serial.begin(9600);
}
void loop() {
int sensorValue1 = analogRead(A0);
// int sensorValue2 = analogRead(A1);
// int sensorValue3 = analogRead(A2);
Serial.println(sensorValue1);
//# Serial.println(sensorValue2);
// Serial.println(sensorValue3);
delay(1000);
}
So I would question your voltage source, or the way it is connected. Did you also connect the minus or GND connection of the voltage source to the arduino's GND?
If I connect nothing at all to A0, then the values change alot around 330. Especially if I come near with my hand or body. Which makes sense as the input pin is floating, and my body functions as an antenna/variable capacitor.