As digitalWrite() has a CRITICAL section - it cannot be called from an interrupt handler. May be good to put a warning in the documentation.