Good afternoon! I had received the 16 mm illuminated pushbutton http://www.adafruit.com/products/1440
and upon reading some arduino books on buttons, i've found out about pull-up and pull-down resistors, but those seem to be different from these since they don't seem to have a positive and a negative like the illuminated pushbuttons.
so my question is, does this 16 mm illuminated push button need a pull-down resistor (or a pull up)? and if so, how do I set it up? I would assume 5V goes to + and a pin, resistor, and ground is connected to -, but i'm not sure.
Any help is appreciated! Please and thank you!
pull down (or pull up) resistor for 16 mm illuminated push b
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- gigglenoodle
- Posts: 4
- Joined: Sat Jan 04, 2014 10:18 am
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: pull down (or pull up) resistor for 16 mm illuminated pu
I think there are two different questions here: You do need a current limiting resistor to protect the LED. That can go on either the + or - side. It doesn't matter as long as it is in series with the LED. http://www.adafruit.com/products/1440#Description
The question of pullup or pulldown resistors pertains to how you connect the switch to your microcontroller. You generally need either a pullup or pulldown to keep the input from 'floating'. If you are using an Arduino, the easiest way is usually to use the internal pullup resistors as described in this tutorial.The forward voltage of the LED is about 2.2V so connect a 220 to 1000 ohm resistor in series just as you would with any other LED to your 3V or higher power supply.
- gigglenoodle
- Posts: 4
- Joined: Sat Jan 04, 2014 10:18 am
Which tutorial?
Do you mean the tutorial for the midi keytar controller from the illuminated buttons product page? or on the arduino website?
as far as I saw on how they had it setup in the circuits on the midi keytar tutorial http://learn.adafruit.com/ez-key-wirele ... ler-guitar , they only had 1 resistor in it, and that was for the LED. but they never said anything for the button input, although now that I look at the button again, for the input side (the big top 2 plugs) it doesn't have a +/- on either side, so i'm guessing that the +/- only applied to the LED (the smaller bottom 2 plugs)?
Sorry to keep asking, I just want to learn and make sure I understand how to do things right. Thanks!
as far as I saw on how they had it setup in the circuits on the midi keytar tutorial http://learn.adafruit.com/ez-key-wirele ... ler-guitar , they only had 1 resistor in it, and that was for the LED. but they never said anything for the button input, although now that I look at the button again, for the input side (the big top 2 plugs) it doesn't have a +/- on either side, so i'm guessing that the +/- only applied to the LED (the smaller bottom 2 plugs)?
Sorry to keep asking, I just want to learn and make sure I understand how to do things right. Thanks!
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: pull down (or pull up) resistor for 16 mm illuminated pu
Sorry - missing link. This is the tutorial I was referring to. Note that there are no external resistors required. Just the internal pullups defined in the code. http://learn.adafruit.com/adafruit-ardu ... tal-inputs
Code: Select all
void setup()
{
pinMode(ledPin, OUTPUT);
pinMode(buttonApin, INPUT_PULLUP);
pinMode(buttonBpin, INPUT_PULLUP);
}
Please be positive and constructive with your questions and comments.