Algorithm wise its easy peasy. Hardware wise, you'll need to know how to use interrupts, and how to use a hardware timer... nothing too bad.
If you'd like to try, i'll write up how you do it, just don't want to take the time to write it till i'm sure somebody needs it. (call me lazy

)
-q