You used the second version where the first argument is the interrupt number. But you actually put the pin number in there (pin 2). Pin 2 is actually interrupt 0. Thats why they recommend you to use the first method. In your case, it should look like: