Hi I need help wiring this 5 pin LED toggle button, I want the button to activate when I press it and the LED to turn on only when pressed. I have tried many wiring configurations like in the screenshot I attached but no matter what I do, either the LED is on and turns off when I
press the button or the led works as I want but the button doesn't activate.
btw I am using mobiflight to control the buttons as I am building a button box for msfs.
usually the letters on the switch back indicate this:
C = Common
NC = Normally Connected
NO = Normally Open
C is connected to
NC when switched "off"
NO when switched "on"
The other two pins are used for GND and Vcc of the integrated Led.
I assume that the led has already an internal resistor to limit the current.
If you use the button with pinMode INPUT_PULLUP you will have to switch the GPIO to GND to detect LOW that signalizes the "on" state.
In this case you could wire as follows:
C to GND
NC - left open
NO to the gpio Pin and to Led GND (Led -)
Led (+) to Vcc
Check or make sure that the button has an integrated resistor to limit the current. Otherwise you should add one externally to avoid damage to the led, the Arduino or both ...
Good luck!
ec2021
If the button is switched on GND will be connected to the pin and Led (-)