Driving 6 IR LEDs using a transistor

I just dealt with this sort of thing a couple months ago. I was trying to get an idea of how much current a cube was using, and when I measured stuff, I found that I had 4 different voltages from 4 different power sources, and all were under 5v.

I used 2n2222 in my transistor cube a couple months ago, and wasnt able to get much help, so I did a bunch of testing. The transistor cube needs between 0 and 240ma, and even the sot23 2n2222s are rated over 350ma, so thats what I used.

It turned out that I needed between 150 and 300 ohms to sink the full 240ma (actually, it was near 240). I ended up using 270 base resistors, because it allowed enough current for LEDs, and It kept the load on the arduino under 20ma (I think it was like 5ma with 270ohm).

I tried calculating things out, but I couldnt figure out what the gain should be, so I made many calculations, then I tried stuff, but a little experimenting, and measuring solved my problem quickly.

I also experimented with some tiny mosfets (a p, and an n), and they were a lot better, I think they drew a fraction of an ma. The mosfets are more expensive, but they seemed like a much better part in my basic testing.