Skip to content

Instantly share code, notes, and snippets.

@kabturek
Created July 14, 2011 10:37
Show Gist options
  • Save kabturek/1082244 to your computer and use it in GitHub Desktop.
Save kabturek/1082244 to your computer and use it in GitHub Desktop.
Arduino port mapping with additional pins PB6 & PB7
const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
PD, /* 0 */
PD,
PD,
PD,
PD,
PD,
PD,
PD,
PB, /* 8 */
PB,
PB,
PB,
PB,
PB,
PC, /* 14 */
PC,
PC,
PC,
PC,
PC,
PB, /* 20 - PB6*/
PB, /* 21 - PB7*/
};
const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
_BV(0), /* 0, port D */
_BV(1),
_BV(2),
_BV(3),
_BV(4),
_BV(5),
_BV(6),
_BV(7),
_BV(0), /* 8, port B */
_BV(1),
_BV(2),
_BV(3),
_BV(4),
_BV(5),
_BV(0), /* 14, port C */
_BV(1),
_BV(2),
_BV(3),
_BV(4),
_BV(5),
_BV(6), /* 20 - PB6 */
_BV(7), /* 21 - PB7 */
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment