serial.begin preventing digitalWrite

Try putting something like

volatile int dummy;

at the top of your sketch