I was aware of the ATMega pin change interrupt facility and intended to write something using this, however -
The minimal impact of the pinChangeInt library is a very reasonable trade off for access to more than 20 external interrupts.
Update: In subsequent tests, the performance impact of attaching an interrupt with PCintPort::attachInterrupt has been measured to be near negligible. In the worst case test there was a 5% overhead (over INT0,INT1 ), in the best case it was actually 15% faster.
So now you don't need to write something? You will just use the new library instead?
Looks like a good find.
So how do we use this library ?
Part 1) Installation
1) Download the zip file from the google code group http://code.google.com/p/arduino-pinchangeint/
2) Copy the three directories cppfix, MemoryFree and PinChangeInt into the libraries folder of your Arduino directory, mine is here - 'C:\arduino-1.0-windows\arduino-1.0\libraries\PinChangeIn'
Part 2) Adding the library to a project
1) To add the library to a project, open the project in the IDE
2) In the 'Sketch' menu you should see a menu item 'Import Library'
3) Select import library and you should see a drop down list of the libraries you have installed, from this list select 'pinChangeInt'
4) You should now see the line #include <PinChangeInt.h> added near the start of you sketch
The library is now installed and included in your project ready for use.