I have been trying to lead you in the right direction, but not providing too many details, because I didn't want to cheat you out of the thrill of success when it all clicked and you figured it out. (Maybe you don't believe in this, but if someone helps me too early it's like spoiling the end of a movie, or pointing out the piece of the puzzle I was trying to find.)
The final, root cause of the problem here is that you don't know how to write code in C. OK...few people really ever truly do know how, but most programmers and many electrical engineers have a working ability in it. This is the course of action I recommend:
1. For this project, just ask for a solution. I could write the code for you pretty quickly.
2. For future projects, go get a book about C programming and work through it. Find one that suits your learning style and speed. Many would recommend Kernighan & Ritchie, you might find something else that works well. The Sams books aren't all bad...just don't expect to actually learn C in 24 hours.
Absolutely, 100% do not be embarrassed by this. I can see that you have been trying hard to get this to work, you ARE learning (just not in a structured enough manner) and you are far beyond many of the people who come into these forums asking only for cut & paste solutions, and who refuse to learn anything at all. I know for a fact you will pick up C quickly, and probably come back in here to teach us a few things.

Let me know if you want a code example that shows the LED effect you're hoping to see.