WriteDigital sample bug fixed