I am a beginner trying to upload the SimpleExample328.ino sketch on my Arduino Uno. When I verify my sketch however, I run into the error:

'AttachPinChangeInterrupt' was not declared in this scope.

I would assume the header file PinChangeInt.h is not in the correct location; currently the PinChangeInt folder (that contains PinChangeInt.h) is placed in the Arduino IDE libraries folder, which I believe is the correct location.

Did I place the header file in the wrong location or does this error result from another cause? Thanks :)

  • 2
    Please edit your question, and post the sketch you are attempting to compile (or, if it is long, post a link to where you found it). Please copy and paste the error messages. Use Ctrl+K on both blocks to indent them so they appear as "code" in the post.
    – Nick Gammon
    Commented Aug 11, 2015 at 21:42
  • Do you mean this sketch: SimpleExample328.ino? I think that library is made for Arduino 1.0, and not the latest 1.6.
    – Gerben
    Commented Aug 12, 2015 at 14:48
  • Oh, yes I do! Where would I find the latest library for PinChangeInt and examples for me to try? Thank you :)
    – Seth Shill
    Commented Aug 13, 2015 at 2:51
  • Did you take a look at the README? “This library is deprecated [...] users are encouraged to migrate to the EnableInterrupt library [...]”. Commented Apr 12, 2018 at 8:22

1 Answer 1


You don't have the library installed. To install:

The .ZIP file will download to your computer. Take note of the location.

  • Open up the Arduino IDE
  • Go to Sketch > Include Library > Add .ZIP library...
  • Browse to the download location
  • Select the PinChangeInt ZIP file

Its done! Compile your program and all should work!

  • @sa_leinand, what do you do? the library was already deprecated in the time the question was asked in 2015
    – Juraj
    Commented Apr 12, 2018 at 9:24
  • 1
    Agreed that the library is depreciated. That doesn't mean it doesn't work. The sketch that the OP is trying to run is actually one of the examples from that library. To get that sketch to run you need to install the library.
    – sa_leinad
    Commented Apr 13, 2018 at 3:19
  • 2
    The library was deprecated and completely rewritten as the EnableInterupt library. The main reason was so that the library is "for all versions of the Arduino", not just the few that PinChangeInt worked for. The OP has tagged the Arduino Uno, which works fine with PinChangeInt.
    – sa_leinad
    Commented Apr 13, 2018 at 3:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.