Toggling the pin
Writing a logic one to PINxn toggles the value of PORTxn, independent on the value of DDRxn.
Note that the SBI instruction can be used to toggle one single bit in a port.
Короче говоря -> запись в PINx (на ATmega48/88/168/328) инвертирует состояние на выходе.
Эту функцию можно ускорить. Из ДШ:
Короче говоря -> запись в PINx (на ATmega48/88/168/328) инвертирует состояние на выходе.
bitToggle(PORTx, pin);
меняем на...bitSet(PINx, pin);