So when the PB is pressed (like pressing the home button on a phone), I want the LED to wait 16ms (which should be about 60Hz/1 frame), then to turn on for 16ms, and back off. When the PB is not being pressed, the LED should be off. In my current setup, instead of the program running once when the PB is pressed, it loops over and over.
I'm using this to simulate a TV when you pull a trigger in Duck Hunt for the NES, so when the trigger is pulled I would like the program to run once and when it is not, the LED should be off.
Thanks