Hi,
I have this simple program to test from scratch and it fails to compile. I get these meesages:
G:\GV\Elektronika\Arduino\arduino-1.0.5-r2\libraries\PinChangeInterrupt\PinChangeInterrupt.cpp:50: error: 'NUMBER_PIN_CHANGE_INTERRUPT_HANDLERS' was not declared in this scope
G:\GV\Elektronika\Arduino\arduino-1.0.5-r2\libraries\PinChangeInterrupt\PinChangeInterrupt.cpp: In function 'void attachPcInterrupt(uint8_t, void (*)(), uint8_t)':
and so on ...
When I look into PinChangeInterrupt.h I see that there are few libraries refered to. Namely, inttype.h and core_build_options.h. I believe they might be causing problem. I looked through Arduino IDE 1.0.5 directories and can find inttype.h in \arduino-1.0.5-r2\hardware\tools\avr\avr\include (can not find core_build_options.h though). Shall I put inttypes.h into \arduino-1.0.5-r2\libraries or am I having some other problem?
#include <PinChangeInterrupt.h>
void setup()
{
pinMode(A0, INPUT); // Pin A0 is input to which a switch is connected
pinMode(A1, INPUT); // Pin A1 is input to which a switch is connected
pinMode(A2, INPUT); // Pin A2 is input to which a switch is connected
attachPcInterrupt(3,pressButton,RISING);
}
void loop() {
/* Nothing to do */
}
void pressButton()
{ // Interrupt service routine. Every single PCINT8..14 (=ADC0..5) change
// will generate an interrupt: but this will always be the same interrupt routine
if (digitalRead(A0)==0) ;
if (digitalRead(A1)==0) ;
if (digitalRead(A2)==0) int aaa=1;
}