Pro Micro INT Pin confusion

I’m looking for some clarity on the pins for interrupts suitable to connect rotary encoders; on the pro micro the info says pin 2 = int1, pin 3 = int 0, pin 0 = int2, pin 1 = int 3, and pin 7 - interrupt 4 (int 6). Is pin 2(int1) the 5th one down when starting top left with TX0? Just underneath J1? And pin 7 (the 10th pin down the left side) as interrupt 4 but what then is INT6?

What pin designation do I use in my code if I want to use int pins? Counting round the board? or the tiny white numbers printed on the board? Or the corresponding INT numbers? This sort of detail is not really explained very well for us rookies.

The Pro Micro uses the Atmel 32U4 microprocessor, this board has INT0, INT1, INT2 and INT3 on pins marked 3 (SCL), 2 (SDA), 0 (RX) and 1(TX) respectively. These are marked as D2, D3, RX and TX on the board.

But those are not the only pins you can use for the interrupts of a rotary encoder; those are pins which have an interrupt dedicated to them and which you can specify to trigger on a type of change (rising, falling, low or high). The other Pro Micro pins can also be used, as each block of 8 pins is associated with a pin change interrupt. This interrupt can be configured to trigger when a given pin changes. The difference is that the interrupt handler “PCINT{n}” is responsible for determining which pin triggered it and what the pin state (high or low) is.

There are many libraries out there for rotary encoders, I have a preference forhttps://github.com/Zanduino/RotaryEncoder (considering I wrote it :slight_smile: ) and that one is limited to hardware interrupts. I’ve got another which uses any pin, but don’t think I put it on GitHub.

Appreciate the info, I actually ended up trying on pins 14 and 16 as they seemed to work best with the FastLED code I was testing.

I shall check out your rotary encoder library as they seem to feature in every project I get involved with!