I started out using the Uno and I was able to get an interrupt working from a rotary library I found online but when I moved the project to the Mega and tried changing it for the different pins it stops. I spent a few hours trying to figure out the interrupt pin on the mega from online sources and just can't find any good resource to explain the mega interrupt pins sufficiently.
I am trying to use interrupts like so.
Rotary r = Rotary(10,11);
void setup(){
PCICR |= (1 << PCIE0);
PCMSK0 |= (1 << PCINT4) | (1 << PCINT5);
sei();
}
ISR(PCINT0_vect){
//stuff
}
It doesnt really matter what pin I am using for the interrupt if someone has a preferred method. I just need it to work.