Use digital pin,both as input and outpout,without always reconfiging the pinMode

settra:
i really hope that when you say that the arduino can operate switches, you mean relays

A relay is a switch operated by a solenoid.