Wiring – How to Wire a 4 Pins Slide Switch

wiring

I want to know how can i wire this toggle switch to obtain 3 positions :

  • Position 1 : Turn Off System
  • Position 2 : Turn On System
  • Position 3 : Write "High" On a microcontroller (ATtiny84)

This is the slide switch i am willing to use : Link

Best Answer

i don't know which pin of the switch is common pin, i think it might be pin no.1 or no.2

if pin no.2 was common, do this wiring :

enter image description here

if pin no.1 was common, do this one :

enter image description here

the diode is preventing Write HIGH on your ATtiny's digital input when you just want to turn it ON and not to do that in same time (Position 2) if you tell me which pin is common pin, i'll give you the exact answer