Update main.c

Added in code to capture the rising edge values on a keypress.