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

I tried 1 and it gave me odd numbers again. A1 does the same thing.
Logged

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

I tried 1 and it gave me odd numbers again. A1 does the same thing.

Then perhaps the problem is an electrical one with the signal going to the analog input pin. What is it's output impedenace? Is there a common ground wired from the arduino to the circuit supplying the measurement signal?

One way to test your software is to remove your signal wire from the analog pin and first wire a ground to the analog input pin and see if your raw count value is a stable 0 value, then remove the ground wire and wire from the shield 5V pin to the analog input pin and see if your raw count value is a stable 1023 value.

Lefty
Logged

0
Offline Offline
God Member
*****
Karma: 39
Posts: 986
Get Bitlash: http://bitlash.net
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm guessing door number 2.  Is it hard to test the other free pins in your setup?

-br

Edit: Nevermind.  The data sheet confirms (p. 63) pin 7 / PB2 is analog input channel 1.  But I would still test the other pins if it's quick… fortune favors those with a slight distrust for the documentation.
« Last Edit: November 25, 2012, 09:23:35 pm by billroy » Logged

Pages: 1 [2]   Go Up
Jump to: