Go Down

Topic: Analog pins problem (Read 830 times) previous topic - next topic

tatulea

Hi,
why when I connect a potentiometer on any analog pin on serial monitor I do not see the potentiometer value.For example if I conect to A0, on serial monitor I see 14.For A1 I see 15.For A2 I see 16.

AWOL

Sounds to me like you're printing the pin number.
Just a guess, based on the lack of code.
"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.

johnwasser

Yes.  'A0' is not a substitute for 'analogRead(A0)'.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

retrolefty

You simply have to post your code (in a # window) for us to tell what you are doing wrong.

Lefty

tatulea

This is the code :

Code: [Select]

void setup() {
  Serial.begin(9600);

}

void loop() {
  Serial.println(analogRead(A5));
 
}


But in this morning I disconnected the I2C RTC and all analog pins is working fine.Which is the problem when I connect the RTC?

fungus

I2C uses Analog pins 4+5
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

tatulea

I know but and on A3 I have a wrong value.

fungus


I know but and on A3 I have a wrong value.


If the problem goes away when you disconnect the I2C RTC then the I2C RTC is probably to blame.

We don't know what the "I2C RTC" is, how it's connected or what pins it uses.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

MarkT

Yes we do, its an I2C device and is on the I2C bus!!

O.P.:  Show us the code for A3 that you claim isn't working - you'll find you were doing something like:

Code: [Select]

void loop() {
  Serial.println(A3);
 
}
[ I won't respond to messages, use the forum please ]

fungus

#9
Apr 08, 2013, 12:42 pm Last Edit: Apr 08, 2013, 12:44 pm by fungus Reason: 1

Yes we do, its an I2C device and is on the I2C bus!!


Yes, but is it a shield? Is there anything else on there? If the problem goes away when he disconnects it, it's suspect.


OTOH 15 for A1, 16 for A2 is even more suspect.


No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

tatulea


Grumpy_Mike

@tatulea
We do not charge by the word you are permitted to tell us more. A DS1307 is just a chip it comes in many forms.

Post the code of what you say is not working and explain the circumstances.

You will be able to read analogue input 3 and use the I2C at the same time.

Go Up