The hardware design really needs to tie in with the software in a case like this.
Look at 2n2222 specs again, I posted it earlier - need a lot of base current to turn them fully on. I don't think thats the right transistor for turning on as many LEDs as you could have on at one time.
1K would limit base current to (5V - 0.7V)/1000 = 4.3mA
You need a lot base current with 2n2222.
2N2222A datasheet.PDF (165 KB)