When I try to compile code that includes the PinChangeInt.h libary I get this message:
In file included from RCI.ino:1:0:
C:\Program Files\Arduino\libraries\PinChangeInt/PinChangeInt.h:301:32: error: 'PCMSK0' was not declared in this scope
PCintPort portB=PCintPort(2, 0,PCMSK0); // port PB==2 (from Arduino.h, Arduino version 1.0)
among other similar errors, does anybody know how to fix it, I spent some time looking online but no one seems to have a solution.
Probably because most of the questions lack detail, like yours. What version of the IDE? Which Arduino? Where did you get the library you are using? Where is your code?
The link was a zip that came with 3 folders (PinChangeInt,Memory Free,CppFix) I placed all three folders in the libraries folder in the arduino directory.
And yes I restarted the arduino IDE, the library shows up in the library drop down menu.
So, what happens if you try to compile one of the sample programs that is distributed with the library? I just installed the library and compiled one of the sample programs without issue.
I loaded and compiled your program after adding the global:
bool state = false;
and it compiled fine.
So, if your IDE is installed at: C://Arduino1.6.5, then your library is at:
UPDATE: The code compiles fine with Arduino UNO but does not work for Arduino NG or older with an atmega8
Why is this and is there a way to port the code over?
Read the data sheets. Atmega8, 8L, 8A hardware does not support PCINT.
You need Atmega48/88/168/328 family to get PCINTs. Same 28 pin DIP & 32 pin SMD package.