my arduino is pro micro and i wanna install small toggle switch
on the board
i made wire at vcc to switch and i made another wire from gnd to pin 8 and made another wire from where pin 8 and gnd is conected to aniother head of toggle switch
but when i turn on the toggle switch it works but when i turn off the switch there is no lights on
i wanna install toggle switch and i dont know how to make it
can anyone help me?
On the Switch :
connect pin 1 or 3 to GND
connect pin 2 to pin 8 on the Arduino
On the Arduino set the pinMode(8, INPUT_PULLUP);
Read the switch in your code, it will go between HIGH and LOW when you activate the switch.
mike-bear:
i made another wire from gnd to pin 8
Please draw an adequately detailed diagram of your configuration. Is pin 8 being used as an output pin? And if it is used as an output pin, then better not connect pin 8 to gnd.
Hi,
Welcome to the forum.
Please read http://forum.arduino.cc/index.php/topic,148850.0.html .
What sort of toggle switch?
Do you know what each terminal on the switch is for?
Can you please post a picture of your project so we can see your component layout?
Thanks.. Tom..
@mike-bear
Other post/duplicate DELETED
Please do NOT cross post / duplicate as it wastes peoples time and efforts to have more than one post for a single topic.
Continued cross posting could result in a time out from the forum.
Could you also take a few moments to Learn How To Use The Forum .
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.
i installed toggle switch without resistor, i wanna know what will be happen if i dont use resistor on board and use toggle switch and is 10k resistor good to use or not?
If wired correctly, no resistor is needed.
pin 8 to pin 2 and connect to one pin of toggle switch
pin 3 to ping GND and connect to another of pin of toggle switch
pert
January 10, 2021, 5:38pm
9
@mike-bear , please study and follow this tutorial to learn how to use a switch and to learn how to use it without the need for an external resistor:
After that, if you still have questions, come back here with detailed and specific questions and we'll help you out.
On a toggle switch you have 3 pins
I will call these from left to right T1, T2 and T3
Connect T1 to 5V
Connect T3 to GND
Connect T2 to Pin 8
in your code, read pin 8 and it will be high(5V) OR low(GND - 0V)
Yet another duplicate merged
Two ways to wire a SPDT (Single Pole Double Throw) switch to an Arduino input.
MarkT
January 11, 2021, 1:04am
13
groundFungus:
Two ways to wire a SPDT (Single Pole Double Throw) switch to an Arduino input.
But the first way is risky, you'll possibly get much more signal bounce while the pin is floating, perhaps
picking up nearby crosstalk.
I'd suggest always using a pullup, physical or internal.
I would always use the second way, but the first one was mentioned so I wanted to show it schematically.
With the second way, an external resistor, for stronger pull-up, may be required if the switch is on long wires to overcome noise.
system
Closed
May 11, 2021, 1:26am
15
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.