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 Aug 11 '15 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 Aug 12 '15 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 Aug 13 '15 at 2:51
  • Did you take a look at the README? “This library is deprecated [...] users are encouraged to migrate to the EnableInterrupt library [...]”. – Edgar Bonet Apr 12 at 8:22

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 Apr 12 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 Apr 13 at 3:19
  • 1
    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 Apr 13 at 3:36

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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