2 and 3 way selector switches

The StateChangeDetection example in the IDE (under examples / digital) would be a useful resource.