January 16, 2014

Converting ATmega328 pin numbers to Arduino board pin numbers

If you're working with Arduino-compatible circuits that are constructed on a solderless breadboard, protoboard or other non-standard formats, sometimes it can be easy to get the pin numbering between the physical microcontroller pin and the sketch pin numbering. Usually this is the result of working late or too much, and can create all sorts of problems when you least expect it. However a simple solution to this has been documented by Arduino enthusiast Winkle Ink on his blog.

The solution is the use of his small ArduinoPins library, which assigns the ATmega328 pin numbers to Arduino IDE pin numbers. Then you can simply include the library and refer to the physical pin number instead of the IDE PIN number. An interesting solution, so for the library and more explanations check out Winkle's blog. And for more, we're on twitter and Google+, so follow us for news and product updates as well. 

If remembering "which pin is which" is an issue for you or someone you know, get some of our labels with Arduino pinouts:

They fit neatly over the ATmega328P and will never leave you guessing as to which pin is Vcc and which is GND. And you can also get the microcontroller with Arduino bootloader with the label pre-fitted as well. For these and more Arduino-compatible products, visit our online store

Leave a comment

Comments have to be approved before showing up.