Go Down

Topic: analogRead(pin) bug, succession wrong (Read 1 time) previous topic - next topic

erich

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

mellis

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.

Go Up