Help Wiring LED push button

Hi,

just bought this button. https://www.adafruit.com/product/481

I want to connect it to my Gemma.

I want the light to be permanently on.

From what I understand to make the light be permanently on I need to connect: - (negative) of button to Ground of my Gemma (I already have something connected on the ground. Is it ok to connect 2 cables at the same time?) + (positive) of button to 3v of My Gemma

Now to receive data input from the button I need to connect: C1 of button to D1 input of my Gemma NO1 of button to D1 input of my Gemma (or NC1 to D1)

I ll also need use the INPUT_PULLUP command from what I understand.

Is that correct? It looks logical to me, but I've read many responses on forums for similar questions and no one has done it like that.

I already have something connected on the ground. Is it ok to connect 2 cables at the same time?)

Yes, not only OK but that is what you have to do due to lack of extra ground pins.

  • (positive) of button to 3v of My Gemma

Yes, although 5V would be a bit brighter.

Now to receive data input from the button I need to connect: C1 of button to D1 input of my Gemma NO1 of button to D1 input of my Gemma (or NC1 to D1)

No. C1 to the ground of your Gemma and NO1 to the input pin. Then enable the pull up resistors.

I've read many responses on forums for similar questions and no one has done it like that.

Their is a good reason for that. ;)

Thanks. So I ll have to connect 3 cables to the ground at the same time? (including the one I had from before) That will be a tight squeeze Is it ok if I connect one of the cables to one of the other 2 cables, instead of directly to the ground?

Yes you can chain them, ground from Gemma to the - on the push, then a wire from the push - to the push C and then from the push C to your other thing.

I connected it. The led on the button is on. 8) And the red light on the gemma is turning off whenever I press the button. I ll take it as a good sign. :)

Sounds good. Note when you press the button the Arduino will see this as a LOW and when it is released it will read the button as giving a HIGH.

Thanks for your help everybody. It's working now. Will this wiring work if I want to make the led fade in fade out? Or do I need to wire the button differently to achieve that?

Yes the LED can be made to fade, it is just software.