Love to live, and live to love

When it can be simple, keep it simple. When it can’t, make it simple!

how to use pin b6 and b7 on atmega 8/16/32 with arduino

Posted by ardnahc pada 10 Mei, 2014

find something like pins_arduino.c or pin_arduino.h (mine in hardware/arduino/variants/standar/pin_arduino.h) and open it using your favorite text editor. find text below and add each 2 lines from this const.

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 */
};

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

 
%d blogger menyukai ini: