[MERGED] How to rewrite code using an interrupt

This topic has been merged into Best way to integrate a interrupt into my code.