replacing serial.Read input by digital.Read