replacing serial.Read input by digital.Read

Look at digitalRead examples and probably the state change detection example.