Just wondering if I am doing something wrong here or do I have a defective Arduino Uno .Code below is taken off the web tutorial TopTechBoy , simple read analog voltage from A0 .I built this circuit as it was described on the web, quite simple using a 5K pot and 5 vdc from Arduino .Basically pin 1 outermost pin +5VDC , center pin A0 , and last pin Gnd . Code written as :
int (potPin=A0);
int (readValue);
void setup() {
pinMode (potPin , INPUT);
Serial.begin (9600);}
void loop() {
analogRead (potPin);// read pot pin and put in read value
Serial.println (readValue);//print results in serial monitor
delay (250);
}
So what I get is all 0,s on serial monitor no matter where I turn the pot to. Something simple I am sure , I put a led between center pin and last pin and I can dim it so the circuit is correct . I then just loaded program on Arduino again for the sake of it and tried just using A0 and move it to gnd then 5 vdc and 3.3 vdc and still all I read on serial monitor is 0's. Driving me nuts, what is wrong?Thanks