Programming burttons - Ic21 and MCP23017

I saw a great post on Nick Gammon's website on using the
MCP23017 port expander to read button presses - possibly to eliminate the
issue I currently have using the Adafruit RGB LCD shield - where polling is required to
read the buttons - I get problems depending on how long (or how short) I press a button.

It seems this link may be the answer:http://www.gammon.com.au/forum/?id=10945
It is not clear to me how (or if) I can tell which button has been pressed.
My application requires five buttons, and I need to know which one is pressed (UP,DOWN,LEFT,RIGHT,SELECT).

I tried to post a reply on the Gammon forum, but for some reason cannot post a reply to his
great information.

Any suggestions will be greats.

Thanks

eholz1

Then example code in Nick's article shows how to read the interrupt flag registers to determine which input (switch) caused the interrupt.

Hello,

I will check and try the code posted in Nick's forum,

thanks