Calculate transistor collector and base resistors values for driving LED with GPIO
I drive from Atmega328P and similar a lot.  Need to limit the current from the uC. These methods work pretty well, and the transistor characteristics do not matter so much. If you have known values (Vbe, Vce, Vf, Rds), plug those in.

For R1, base resistor, assuming Vbe of 0.7V for R1, and current flow of 20mA to push transistor into saturation, then (5V - Vbe)/.02A = resistor. 

If a MOSFET, have to deal with gate input capacitance, then its just 5V/.02A for the resistor. That capacitance looks like a short (to Gnd when driving high, and to Vcc if driving it low), so the resistor just limits the initial current rush as the cap charges or discharges.

Select R2 to limit the LED current. Assuming Vce of 0.7V, Vf of LED (you can use a 5V source and 1K resistor and measure it), then R2 = (Vsource - Vf - Vce)/0.02A (20mA) = resistor value. Maybe even solve for 10mA, or 5mA, modern day LEDs can be really bright at 20mA, and it also depends on the lens type, and the color.  Old LEDs had poor brightness, new ones are much brighter.