You mean like thisNot quite.
The interrupt routine must be COMPLETELY SEPARATE from the main routine. There are no edges (arrows) between your main routine and the interrupt routine. . That connection is done by the hardware, Your first interrupt routine was essentially correct.
Note: I Forgot to initialize LED at top
Last edited: