Using a microcontroller to make a series of LEDs blink one after the other

This may seem like a nooby question, but I have a cycle light with 5 LEDs:

* * * * *

And it has a button, which when pressed hase different modes:

• 1st press: all LEDs blink together
• 2nd press: all LEDs stay lit
• 3rd press: 1st LED goes on, then it goes of and 2nd LED goes on, so on till 5th, then 4th LED again...
• 4th press: it turns off.

I was wondering how to make this. I can make a simple circuit so that all are on. I was thinking, that something like an 8-pin microcontroller can be used to make them blink together, but for them to blink independently, I guess I will have to use a microcontroller with enough pins so that each LED has it's own?

But my bike light is pretty small and I don't think it is running an AtMega32 or something. How does it work?

• It uses a very small MCU. Aug 16 '15 at 19:53
• There are smaller and cheaper microcontrollers than ATmega32. Also there are chips specifically made for bike lights, the number of devices produced is so large that is more efficient to have an application specific IC (or ASIC). Aug 16 '15 at 19:53
• An 8 bit shift register with a slow clock and a handful of diodes could be used to achieve this - no need for a whole microcontroller. It would be a more interesting project to see if you can build this from "discrete" components rather than throwing a micro controller at it. Especially if you are a "noob" by your own admission. Challenge yourself a bit... Aug 17 '15 at 0:45