I just assembled my Adafruit Proto Shield including the 3 wires for the 2 LEDs and the switch. I wanted to wire the LED to the switch so that when the switch is pressed, the LED lights.
However, the LED is connected to ground (through resistor), and the switch is connected to ground. Is there still some way to press the button resulting on the LED coming on?
Thanks!
protoshield, using button to turn on LED
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_bill
- Posts: 88154
- Joined: Sat Feb 07, 2009 10:11 am
Re: protoshield, using button to turn on LED
Electrically, you could cut the ground trace and wire either the switch or the led to +5. However, since both switches and LED2 all share the same ground trace, you would need additional jumpers to maintain ground continuity for the other components.
Or you could do it in software. Connect the switch to a digital input & the LED to a digital output and write a couple lines of code to control the LED based on the switch input.
Or you could do it in software. Connect the switch to a digital input & the LED to a digital output and write a couple lines of code to control the LED based on the switch input.
Please be positive and constructive with your questions and comments.