Hi everyone,
I'm using a ProMicro clone of the Leonardo. Today I downloaded EnableInterrupt library 1.0.0.
I got the impression that I would be able to use External and Pinchange interrupts together, but maybe not? or maybe it's a library bug ?
I've got the two types of interrupt working fine separately, but just including the EnableInterrupt library with my external interrupt code gives me compile error
#include <Keyboard.h>
#include <HID.h>
#include <Mouse.h>
#include <EnableInterrupt.h>#define pinA 3 //Roller A Externasl
#define pinZ 8 //Spinnerlong cntX=0; //counter for mouse X-axis
long lastcntX=0;void setup() {
//pinMode(pinZ, INPUT_PULLUP);
//enableInterrupt(pinZ,doZCount, CHANGE); // PinChange 8us+pinMode(pinA, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(pinA),doACount,CHANGE); //External 2us+Mouse.begin();
Keyboard.begin();
}
void loop() {
//send mouse update to usb
if(cntX!=lastcntX ){
Mouse.move((cntX-lastcntX),0);
lastcntX=cntX;
}
}
void doZCount() { // spinner is moving
cntX = cntX +1;
}
void doACount() { // ball is moving
cntX = cntX -1;
}
WInterrupts.c.o (symbol from plugin): In function `attachInterrupt':
(.text+0x0): multiple definition of `__vector_1'
C:\Users\jimbo\AppData\Local\Temp\arduino_build_399664\sketch\sketch_HID_017_TRAK_and_Spin_PCint_v01_bad_02.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
WInterrupts.c.o (symbol from plugin): In function `attachInterrupt':
(.text+0x0): multiple definition of `__vector_2'
C:\Users\jimbo\AppData\Local\Temp\arduino_build_399664\sketch\sketch_HID_017_TRAK_and_Spin_PCint_v01_bad_02.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
WInterrupts.c.o (symbol from plugin): In function `attachInterrupt':
(.text+0x0): multiple definition of `__vector_3'
C:\Users\jimbo\AppData\Local\Temp\arduino_build_399664\sketch\sketch_HID_017_TRAK_and_Spin_PCint_v01_bad_02.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
WInterrupts.c.o (symbol from plugin): In function `attachInterrupt':
(.text+0x0): multiple definition of `__vector_4'
C:\Users\jimbo\AppData\Local\Temp\arduino_build_399664\sketch\sketch_HID_017_TRAK_and_Spin_PCint_v01_bad_02.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
WInterrupts.c.o (symbol from plugin): In function `attachInterrupt':
(.text+0x0): multiple definition of `__vector_7'
C:\Users\jimbo\AppData\Local\Temp\arduino_build_399664\sketch\sketch_HID_017_TRAK_and_Spin_PCint_v01_bad_02.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status