analogWrite not switching to digitalWrite

Thanks, adding the pinMode again worked.