Dynamically assign ground pin?


I’ve got a Nintendo DS touch screen, the four connections on it need to be dynamically switched between +V, AnalogIn and ground in order to read x and y.

Swapping AnalogIn is easy, supplying +voltage is easy too (AnalogOut at full), but I can’t figure a way to dynamically set an analog pin to behave like a ground pin.

Any smart ideas out there? I’m angst to jump in with a hardware solution if there is a software solution.

Thanks in advance,


Setting a pin low = making it ground

Thanks for that, Unfortunately I’ve just realised the Panda II only has one analog out, so using 2 analog pins to swap between reading and supply voltage is a non-starter. Back to the drawing board.

touch screens need analog in not analog out!

Use any digital out pin for voltage.

can you tristate a Analog pin to read a voltage in? The three states you need are digital out (as a 1, to get V+ and 0 to get GND), and then analog in.