I'm in the process of assembling something and I want to double-check with you all to determine if this is the best way to do such a thing.
I have a 2-position switch (with 3 prongs similar to this but much much smaller). I want to detect the position of the switch with a single picaxe input pin. Also, I want one LED to illuminate if the switch is one direction, and a different LED to illuminate if the switch is in the other direction. I also want to prevent the input pin from floating. I want the circuit to be as simple as possible.
(the resistor between 5v and the switch is of a resistance that provides safe LED illumination)
Does this represent the easiest/simplest way to do such a thing? What type of resistance would be best for grounding the input pin? (I'm assuming higher than lower?) Does it really matter? Additionally, will this circuit reliably prevent a floating state? Is there a better way? I'm a newbie and I feel like I'm just tossing parts at this project without thinking it through properly...
I have a 2-position switch (with 3 prongs similar to this but much much smaller). I want to detect the position of the switch with a single picaxe input pin. Also, I want one LED to illuminate if the switch is one direction, and a different LED to illuminate if the switch is in the other direction. I also want to prevent the input pin from floating. I want the circuit to be as simple as possible.
(the resistor between 5v and the switch is of a resistance that provides safe LED illumination)
Does this represent the easiest/simplest way to do such a thing? What type of resistance would be best for grounding the input pin? (I'm assuming higher than lower?) Does it really matter? Additionally, will this circuit reliably prevent a floating state? Is there a better way? I'm a newbie and I feel like I'm just tossing parts at this project without thinking it through properly...
Last edited: