The problem is, when looking at that sample code, I see only the part of code, which runs on interrupt. I have no idea where to insert the "main" code?