Transistors and Resistors

If all you're doing is switching, use a MOSFET and skip the math. A 220ohm resistor between the pin and gate (analogous to a BJT's base) helps prevent goof-ups and over-current from capacitance, but with a FET, the value of that resistor is not critical at all. Anything from 10R to 10k would probably work.