Switches? I don't need no stinkin' switches! Or do I? [duplicate]

Solution 1:

Buttons would certainly solve that problem, but you could also use an XOR gate between two switches which is how two-way switches work in the real world.

XOR Truth Table

  A  |  B  |   C 
-----+-----+--------
  0  |  0  |   0
  0  |  1  |   1
  1  |  0  |   1
  1  |  1  |   0

As you can see, if either A or B changes (either of your switches), C (the output--your door) will as well.

There are a bunch of these on the YouTubes, but here is one that operates a set of double-doors:

Solution 2:

Use a button. It's far easier and you won't need to worry about closing the door behind you. On my SMP server I've had problems with people leaving doors "open" so I place a button on the outside to get in, and a pressure plate on the inside to allow for easy exits.

Solution 3:

You can use an XOR like Nick said, or you can opt to use something called a T Flip-flop. Basically, that's a fancy way to say toggle button.

Just build one and connect a button to it, then route the output to the door. The advantages? You can connect as many buttons to one T Flip-flop as you want and they'll still always toggle the output. They're also really easy to build if you know the most compact design. You can find many designs on the wiki, or you can just go with this diagram of two compact ones:

enter image description here

Take your pick!