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.
Sounds to me like you're printing the pin number.
Just a guess, based on the lack of code.
Yes. 'A0' is not a substitute for 'analogRead(A0)'.
You simply have to post your code (in a # window) for us to tell what you are doing wrong.
Lefty
This is the code :
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?
I2C uses Analog pins 4+5
I know but and on A3 I have a wrong value.
tatulea:
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.
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:
void loop() {
Serial.println(A3);
}
MarkT:
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.
I use DS1307.
@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.