I highly (and heartily) recommend that you consider using Ken Shirriff's IRremote library. Read all about it (and lots of Infrared Remote stuff) here: Ken Shirriff's blog
. It is designed to work with modules like yours. (I use a different receiver, but the principles are the same.)
If you want to implement a minimal amount of code to work with your specific controller, a good way might be to use Ken's IRrecvDemo
examples as a starting point and then simplify to your heart's content. (For example, you can start by leaving out all of the IRsend stuff if you are only interested in receiving.) See Footnote.
That's just an opinion and it's worth exactly as much as you want it to be worth.
Here's my methodology: Start with something that works.
Then try making it "better" (smaller, faster, more elegant, whatever...)
The worst case fallback position is that you have something that works.
You might even learn something by looking at other people's approach to problem solving (and other people's code) even if your way is "better." (Note that Ken's excellent code doesn't have a single PulseIn
function call, in spite of what you have read somewhere.