This question already has an answer here:
I'm new to electronics, so I thought I'd start simple and just connect an LED to the GPIO on the raspberry pi, to pin 1 (3.3v) and the ground pin. But I'm having trouble calculating the resistor I need. On many websites it says the resisitor I need is about \$300\Omega\$, such as this one here, but none of the websites explain how to get to this value. I did physics at school and used the formula \$V=IR\$, and know that current is the same in all places in a series circuit.
The LED I have didnt come with any data, but looking on the Internet it suggest that the voltage drop across green LEDs is about 2.2v, and the max current is 20mA.
So the resistor will have a drop of 1.1v (the 3.3v from the source minus the 2.2v dropped across the LED), and the current through it should be 0.02A, so I did:
which is nothing like the \$300\Omega\$? what am I doing wrong or misunderstanding?