Reading a digital output