Can you run an LED with analog pins?

Thank you. I am using Port Manipulation to run the LED's. I need to make a very simple array where one LED turns on and the previous turns off, then the next one turns on and the previous off (something like a shooting star or a knight rider). With Port Manipulation I've been able to clean my code however I have never tested it with more than 20 LED's.

The way charlieplexing works, you can't really control 2 LEDs on at the same time, you're limited to 1 at a time. If you try and turn on 2, you get some group coming on depending on just how you set up your array. The way to get arround this is to store in memory which LEDs should be on and cycle through them very fast with only one on at a time. If you only go through the "on" LEDs, then it will take longer with more LEDs on, so each LED is on for less time out of each second. To keep the brightness consistent, you keep the delay even if each LED is off.

So for n LEDs, each one can be on at most 1/n of the time. But if you're limiting yourself to a few LEDs on at time, you don't need to worry about duty cycle, you can have each on for 1/10th of the time for example, which will be just fine no matter how many LEDs you use.