Move write procedure to actual digitalWrite method.