There's a whole bunch of information (on IR and motors) on the site I posted way back in post #2, all for the sake of you showing some effort to read it.
You're not going to learn this stuff overnight, and we're not going to post it here over several hundred messages for you to digest one bite at a time.
It's like you're incapable of helping yourself.
I mean, if you posted "I've read <link>, but "this sentence" is confusing me", that at least would show that you're showing some initiative. But all you're doing is posting the same old "help me, I'm lazy" posts.
TBH, this kind of low-level development requires a hell of a lot more enthusiasm to read up on and try things for yourself than what you're showing at the moment. You're going to need that to investigate what's happened when it all does wrong (as it will do). If the only debug you have is a flashing LED, then you've got to get creative!.
Unlike portable ANSI-C which will work pretty much anywhere, any code you produce will only work on YOUR hardware. Which pretty much means you're on your own, and all we can do is offer suggestions (rather than answers).
Do you even have a hardware kit to hand? If so, tell us which one.
And I don't mean something vague. Be specific, post URLs.
Here's another forum which has lots of info on low-level programming / hardware development.
http://www.avrfreaks.net/