Hi everyone!
My question is regarding the tutorial on LED flashing. Is it safe to just wire a LED to pin 13 and the other one to ground?
I noticed this warning:
"Short circuits on Arduino pins, or attempting to run high current devices from them, can damage or destroy the output transistors in the pin, or damage the entire Atmega chip. Often this will result in a "dead" pin in the microcontroller but the remaining chip will still function adequately. For this reason it is a good idea to connect OUTPUT pins to other devices with 470-ohm or 1k resistors."
Also it warns you to use a resistor in series when using low impedence (output) mode.
So I'm wondering, if I want to do the light flashing example (http://www.arduino.cc/en/Tutorial/Blink), is it safe to wire it like in the picture? Or should I use a 470-ohm or 1k resistor in series???
Yes, I am a newbie. I used to play with electronics and I burned out lots of LEDs (and transistors for that matter) by not using any resistance at all.
How do you calculate what resistor to use with the device for a LED? I know V = I R but what does that mean? I've taken differential equations and linear algebra and a calculus based physics course, so I know the gist of it . . . I sort of know the difference between a voltage and current and resistance, but if I have the code shown below, what is the V, I, and R?
How exactly do I use ohm's law to keep the LED from burning out? What current will be output, will it be 40 mA? Will it be a source or sink? I take it a source because the wired thing uses the other LED wire as ground.
Thanks in advance,
Willow
int ledPin = 13; // LED connected to digital pin 13
void setup()
{
pinMode(ledPin, OUTPUT); // sets the digital pin as output
}
void loop()
{
digitalWrite(ledPin, HIGH); // sets the LED on
delay(1000); // waits for a second
digitalWrite(ledPin, LOW); // sets the LED off
delay(1000); // waits for a second
}