The numbers in pink are the Arduino pin numbers. More advanced users like to access pins and ports directly (such as " PORTB |= _BV(7) " to turn bit 7 on Port B on, but that statement will only work on the particular Atmel chip (2560, 328p, etc.) being used.ĭirect access bypasses the Arduino "translation" layers and gives you a bit more speed, but in most cases it's easier to say something like " digitalWrite (13, HIGH)" than it is to turn on a particular bit in a particular port to do the same thing.įor some reason I thought that these graphics that are common around the web would have some relation to the pin names used in the IDE However, the exact PIN that is used for pin 13 (such as "PB7" or "PK0" will be different from board to board. For example, "Pin 13" will always respond to programming such as "digitalWrite (13)" no matter what board you have. The various Arduino boards are setup to be easy to use. I've been using Nanos and Pro-minis almost exclusively up till now, and they don't have any repeated/duplicate pin names. this only took an hour to figure out why I couldn't get pin 89/8 to function properly. Why is pin 53/PC0 along the bottom edge also labeled A8? Addressing this pin as PK0, eg, pinMode(PK0, OUTPUT), does not create an error message, but it also doesn't set the pin. When you do a pinMode(A8, OUTPUT), the pin that is set is 89/8 on the left side. Along the bottom edge, pin 53 is also shown as A8. On the mega, along the left side, port K (PK0) is shown variously as pin 8, pin 89, PK0, A8, and ADC8.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |