Is this diagram stupid, or am I crazy?

For makers who have purchased an Adafruit Starter Pack, get help with the tutorials here!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
johnnyr
 
Posts: 3
Joined: Sat Nov 13, 2010 2:15 pm

Is this diagram stupid, or am I crazy?

Post by johnnyr »

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!

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

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

Post by adafruit_support_rick »

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.

User avatar
westfw
 
Posts: 2008
Joined: Fri Apr 27, 2007 1:01 pm

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

Post by westfw »

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
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

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

Post by adafruit_support_rick »

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

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

Return to “Arduino Starter Pack”