All of this post is just an attempt to help people getting started. Nothing profound. No questions.
Ohms' law works... except when it doesn't... and LEDs break Ohms' law!
Rare, but it happens. Happens inside transistors, too, where I still don't understand it all! But I understand LEDs!...
Think about them like this...
REGARDLESS of the current flowing through them the voltage will "drop" by a fixed amount. (Well... until the current gets higher than the LED can take, then it will go "poof", and REALLY start ignoring Ohms' law.)
The rest of the circuit WILL obey Ohm's law. So if you have an LED that causes a voltage drop of 2 volts, and you are powering things with 5v, it will behave as if you have 3 volts! Do your I=V/R with 3 volts and the value of the resistor you are using, and you'll know the current that will flow. (Don't factor in anything for the "resistance" in the LED. That's taken care of by what you've "left out" of the voltage moving the electrons.)
Strange but true! I haven't explained that very well, but I know when I first met "non-Ohmic devices" they really threw me, until I finally understood what "non-Ohmic" meant.
===
PS... someone kindly sent a PM disputing my "LEDs break Ohms' law..." And you what they say... if one person comments, 10 people had the same thought.
a) I was speaking in jest... always dangerous with expressionless email, etc.
b) But in jest with a serious purpose. Electronics being "science", we expect "laws" to be obeyed. And novices can be forgiven for thinking that Ohms' law is a general law. For not realizing (as I didn't... and it was a major barrier for me in several areas of early hobbyist electronics) that Ohms' law, while generally true can't be applied "simply" in every corner of the circuit.
Take the simple 5v supply- connected to- LED- connected to- resistor- connected to ground...
Ohms' law WORKS!... IF you know that you treat the LED as having "no resistance", BUT that the voltage "below" it (a dangerous shorthand, by the way) is the voltage "above" it, minus the LED's "Vf" (forward voltage) (which you get from data sheet, or by working backwards from what you see if you set something up that would be "okay" if the Vf is 2v (a good approximate value for many LEDs... sometimes more, so you're starting from the "safe" assumption, aren't you? And 20mA is reasonable for most power supplies and LEDs... but do your "what is this LEDs Vf" experiments directly across your power supply... if the current is much higher, it is too high for an Arduino pin. (Higher currents through your LED, with Arduino control, is done by using the Arduino to use a little current to "turn" a transistor "on" and "off".)
The person who wrote quite rightly pointed out that HUMAN laws vary from one place to another. I drive on the left in the UK, and on the right in the US.
But Ohms' law is a law of science... Apples accellerate at 9.8 m/sec/sec whether they are falling from an English tree or one in the US.
For MORE, if you can stand it! LED resistor basics... LEDs with Arduino- an introduction- aht0led
Voltages: They are always BETWEEN two places. Usually, we quote the voltage between a stated point and ground. But you can measure it across other pairs of points, and when you do, you usually call the number a "voltage drop". In the Vss /LED/ (wire A) / resistor/ Gnd example above, if Vss "is" 5v... i.e. you get "5v" when you connect voltmeter to Vss and Gnd...the "drop" across Vss-WireA would be about 2v. And if it was exactly 2v, then the drop across wireA-Gnd would be exactly 3v.