Is this diagram stupid, or am I crazy?
Moderators: adafruit_support_bill, adafruit

Is this diagram stupid, or am I crazy?

by johnnyr on Thu Aug 30, 2012 6:18 pm

I'm getting this from the "Getting Started with Ardunio" Book by makershed.

This diagram is throwing me off, and I'm hoping you guys can clear it up.

http://imgur.com/oRFZT

1) Why are we using a resistor for the switch?

2) If we Need the resistor, does it matter where the resistor is placed in the circuit? Shouldn't it be on the 5V side, before the switch?

3) Does the wire with the red arrow benefit from the resistor?

4) Shouldn't we be using a resistor for the LED?

Thanks!
johnnyr
 
Posts: 3
Joined: Sat Nov 13, 2010 2:15 pm

Re: Is this diagram stupid, or am I crazy?

by adafruit_support_rick on Thu Aug 30, 2012 8:44 pm

The resistor is a pull-down. It keeps the digital pin low until you push the button, which connects 5V to the digital pin and pulls it high. While it's not the "wrong" way to do it, most people usually use the internal pull-up on the digital pins, and have the switch short to GND.

Digital 13 is a special case - it already has the current-limiting resistor for the LED built-in.

adafruit_support_rick
 
Posts: 13894
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: Is this diagram stupid, or am I crazy?

by westfw on Thu Aug 30, 2012 10:53 pm

Digital 13 is a special case - it already has the current-limiting resistor for the LED built-in.

Not on any recent version of Arduino... If you already have a pin13 LED on the board, then you DON'T have a current-limiting resistor leading to the connector. That dates back to pre-diecimilla days.
User avatar
westfw
 
Posts: 1373
Joined: Fri Apr 27, 2007 1:01 pm
Location: SF Bay area

Re: Is this diagram stupid, or am I crazy?

by adafruit_support_rick on Thu Aug 30, 2012 11:27 pm

westfw wrote:That dates back to pre-diecimilla days
Ah… thanks!

adafruit_support_rick
 
Posts: 13894
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY