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 :)
-
2Please 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– Nick Gammon ♦2015年08月11日 21:42:49 +00:00Commented 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– Gerben2015年08月12日 14:48:11 +00:00Commented 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– Seth Shill2015年08月13日 02:51:12 +00:00Commented 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 [...]".Edgar Bonet– Edgar Bonet2018年04月12日 08:22:43 +00:00Commented Apr 12, 2018 at 8:22
1 Answer 1
You don't have the library installed. To install:
- Go to https://github.com/GreyGnome/PinChangeInt
- Click the green
Clone or Download
button - Select
Download ZIP
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 20152018年04月12日 09:24:23 +00:00Commented Apr 12, 2018 at 9:24
-
1Agreed 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– sa_leinad2018年04月13日 03:19:09 +00:00Commented Apr 13, 2018 at 3:19
-
2The 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– sa_leinad2018年04月13日 03:36:19 +00:00Commented Apr 13, 2018 at 3:36