Pages: [1]   Go Down
Author Topic: Arduino nano V3 pins messed up  (Read 1007 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I've bought an Arduino Nano V3 on ebay (http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=281041059063&ssPageName=ADME:X:RTQ:US:1123)
and started to play with it - it works, but not as I expected.
Thing is, that I've connected led to A0 that according to this image should be pin 19:


and set it to high, but it would not light up, so I changed pin number in code until I've got led to light up - it was on pin 14. Also I've tried pin D10 -which should be pin 13. As long as pin 13 is connected to led on Arduino board, I was expecting to light up two leds - led on board and my connected led outside, but only led on board was shining.

So question is - is it possible, that there is some kind of alternative Arduino nano pinout and the Arduino board I've bought uses it did I something messed up/understand not correctly?
Logged

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

I believe the problem is only that you are confusing the physical pin number on the chip (19) with the assigned digitalWrite logical pin number for A0, which is correctly 14.

-br
Logged

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

So is there any simple rule/diagram how to map logical pin to physical pin?
Logged

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

The pin assignment diagrams here are helpful:

    http://arduino.cc/en/Hacking/PinMapping

You already worked out the only hard part, though: on a '328p arduino, the analog pin X is digital pin 14+X.

-br
Logged

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

Actually there is a lot of room to get confused with on pin numbers/names.

There are the official arduino shield pin names, D0-D13, A0-A5 (D14-D19 also works) that you use
in your sketch code, no matter what kind of avr 328P based board you are using.

There are the Atmel AVR 328p chip physical pin numbers which are different depending on if you are talking
about the DIP package or one of the SMD packages.

Then there is the physical 30 pin package pin numbers that the Nano uses, which is different then any
of the other arduino 328P based boards. You don't use these nano package pin numbers directly in your sketch code,
you must use the standard Uno shield pin numbers/name, which are printed in white with the official arduino shield pin number/names.

By the way if you haven't seen this yet the Asians have come up with a nice 'mother board' for the nano package
the allows more ways to connect to pins and uses proper shield pin numbers/names on the silk-screening.

http://www.ebay.com/itm/Nano-I-O-Expansion-sensor-Shield-For-Arduino-UNO-R1-Nano-3-0-duemilanove-2009-/310546482805?pt=LH_DefaultDomain_0&hash=item484e034675

Lefty
Logged

Pages: [1]   Go Up
Jump to: