We have 4 switches/buttons tied to GPIO/IO ports on the PIC24HJ256GP610A at the center of our design. Our use of Switch 1 and Switch 2 is very simple – we just poll them. They are initialized as:
#define TRIS_RFA_BUTTON TRISBbits.TR..