Reading and writing to the same Arduino Pin