Pages: [1]   Go Down
Author Topic: Analog pins problem  (Read 732 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 290
Posts: 25770
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sounds to me like you're printing the pin number.
Just a guess, based on the lack of code.
Logged

"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.

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 201
Posts: 8695
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes.  'A0' is not a substitute for 'analogRead(A0)'.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17262
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Lefty
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is the code :

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?
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 144
Posts: 5336
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I2C uses Analog pins 4+5
Logged

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

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 144
Posts: 5336
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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

0
Offline Offline
Shannon Member
****
Karma: 200
Posts: 11694
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
void loop() {
  Serial.println(A3);
 
}
Logged

[ I won't respond to messages, use the forum please ]

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 144
Posts: 5336
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


« Last Edit: April 08, 2013, 05:44:14 am by fungus » Logged

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

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I use DS1307.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33371
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@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.
Logged

Pages: [1]   Go Up
Jump to: