protoshield, using button to turn on LED

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
mevans7
 
Posts: 1
Joined: Fri Sep 23, 2011 4:26 pm

protoshield, using button to turn on LED

Post by mevans7 »

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!

User avatar
adafruit_support_bill
 
Posts: 88092
Joined: Sat Feb 07, 2009 10:11 am

Re: protoshield, using button to turn on LED

Post by adafruit_support_bill »

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.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”