Most basic of things, I don't know why it won't work... f*** this is bull****
I know there was some retarded thing about having to use the onboard pullups or the example doesn't work... but it still doesn't work with those, so it must be something else.
Nothing is connected except a Potentiometer (Gnd, pin 16 (a2) and 5v)
sensorValue = analogRead(sensorPin); Â Â
Serial.println(sensorValue );
Shows it's just spraying out random numbers... around 500. (out of 1023)
waving a hand around shows it's just ambient noise.... even though the pullup resistors are on, making this impossible...
The same numbers spray even if the Pot is removed and it's just reading an open pin...
Do the pullups not work on Analog pins?
(Nothing else is attached to the arduino, I pulled an entire project apart just for this one, F********ng part! that I use in 20 other programs without any problems, and everything has continuity)
It's been my experiance that getting mad at the Arduino board/IDE/sketch/yourself does not speed up the process of finding and correcting a problem. Many are able to read a simple pot via analogRead() so there will be an explanation once you provide enough details for us to help you with it.
10k pot, middle pin connected to arduino pin analog 2...
Swapping out the potentiometer does nothing
(The pullup resistors work properly now... For some reason
pinMode(Pot, INPUT); // set pin to input
digitalWrite(Pot, HIGH); // turn on pullup resistors
Doesn't work, (Pot =16) while
pinMode(16, INPUT); // set pin to input
digitalWrite(16, HIGH); // turn on pullup resistors
Works perfectly... it also has to analogRead (2) instead of Pot, or 16.... which is the dumbest thing I've come across since you can call pin 16 for all other functions and it knows you meant analog 2
Wow... no damn way... the Breadboard Main power rails don't have continuity.
Solved I guess thanks for your time!
(Also, Pin 25? I don't remember any of the pins being called over 20 in software)
As far as pin numbers, analogRead() expects a either a value from 0 to 5 (on a 328p based board) or the alias defined values of A0 to A5. So while you can use a analog pin as a digital pin using a digitalRead() command using pin numbers 13 to 19 you can't use numbers 13 to 19 with a analogRead() command. It's just how they wrote those functions to work.
Pin 25 is the number of the pin on the 328 chip, not in the software.
All large bread boards have a break in the middle, you can see that by a gap in the line painted on top of the board.
As already said, using "16" to read an analog input doesn't make sense. That pin number is for treating the pin as a digital pin.
Also, turning on the pull up resistor when connected to a Potiemeter doesn't make sense either. Again, you use pull up resistors with digital inputs, not analog.