Pages: [1]   Go Down
Author Topic: analogRead(pin) bug, succession wrong  (Read 1193 times)
0 Members and 1 Guest are viewing this topic.
Oslo
Offline Offline
Newbie
*
Karma: 0
Posts: 37
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

hi,

i dont know if this is already mentioned somewhere
but using analoRead(pin), the numbers are upside down regarding the pin numbers on the board.
analogRead(0) reads physical analog in pin 5
analogRead(1) reads physical analog in pin 4
analogRead(2) reads physical analog in pin 3
analogRead(3) reads physical analog in pin 2
analogRead(4) reads physical analog in pin 1
analogRead(5) reads physical analog in pin 0

best

erich
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It's a known problem, explained in the FAQ (why am I getting garbage data from analogRead()): http://arduino.berlios.de/index.php/Main/FAQ

It will be fixed in release 0003 of the Arduino software (coming very soon).

The original Arduino boards had the pins numbered in the opposite order, and the software was kept unchanged for compatibility with the old boards, but now that there are so many more boards with the numbering, the software will be updated to that scheme.
Logged

Pages: [1]   Go Up
Jump to: