PaulS:
Why do you think you need an interrupt to read the state of a switch? I'm almost certain that you don't.
In the book I'm currently using as my main reference, it says that being able to use interrupts and counters is what separates good microcontroller programmers from great. Reading a button may seem simple enough, as long as your program does nothing more, but most programs do.
In the book I'm currently using as my main reference, it says that being able to use interrupts and counters is what separates good microcontroller programmers from great.
No. Being able to use interrupts separates adequate programmers from good programmers. Great programmers recognize WHEN an interrupt is appropriate and use them ONLY then.
Reading the state of a switch is something the Arduino is capable of doing 1000's of times per second as long as there is no blocking code.
Reading a button may seem simple enough, as long as your program does nothing more, but most programs do.
and the vast majority of properly written programs do not need to use an interrupt to read the state of an input even if the program does many other things.
My trouble is I am trying to display data of the MPU 6050 to a SPFD5408 Screen. However, the SPFD5408 needs pin D2 and D3 to work properly on the Nano, and the MPU6050 needs pin D2 for the interrupt, The two modules don't co-exist. Someone on this forum suggested me to look into pin change interrupt as the solution. That's why I want to learn about pin change interrupt.
Like I said, I am still very foggy about pin change interrupt. My understand of the concept of pin change is that in the code I can manipulate any capable pins, such as D10 on the Nano to be an interrupt hence the Nano can have one more interrupt pin in addition of pin D2 and D3. Am I totally wrong about that?
My understand of the concept of pin change is that in the code I can manipulate any capable pins
No, you can't manipulate the pins. A pin that supports pin change interrupts can trigger an interrupt when the pin changes state.
What, specifically, is your problem? The pin change interrupt library shows how to assign handlers and provides some clues about what a handler can do.