Code reconfiguration

I already linked to a page for function prototypes. Here is a page on interrupts and interrupt service routines. Lots more information with a google search for "arduino interrupts".