After teaching it the correct variable syntax here is the revised program. Note that ASM is not used this time:
Whatever examples it found to copy it also switched from using interrupts to using a polled method.

You can probably find the same results using a search engine.