You need brackets { } around the code block associated with if (gotIRQ).
What sort of debugger do you have available?
Places I would start is to set a breakpoint inside the interrupt routine to see if you get an interrupt from the encoder.
Then see what happens when you set a breakpoint in the 'gotIRQ' block.
What sort of debugger do you have available?
Places I would start is to set a breakpoint inside the interrupt routine to see if you get an interrupt from the encoder.
Then see what happens when you set a breakpoint in the 'gotIRQ' block.