I am designing a measurement system based on a single pin. When the pin is connected to GND, it means move right. If the pin is not connected to anything, no action happens.
The system was contolled by button switch originally, but I want to control it with a mouse such that when the mouse moves right, the pin is connected to GND, and when the mouse don't move, the pin is connected to nowhere.
I have tried to connect the pin to an Arduino UNO's 3rd pin. Whenever mouse's rightward moving is detected, the 3rd pin should be connected to ground. When the mouse's moving is something else than rightward, the Arduino UNO's 3rd pin should work as if it was not connected.
I think that making the 3rd pin act as GND can be done by
analogWrite(3,0), but how can I simulate "connected nowhere"?