Hello everyone, I am a student from Taiwan, study for mechatronic.
My English is very poor, but I would like to share the code.
I use Arduino Mega1280 to control DC motor with rotary encoder feedback.
Initially, I use the external interrupt ,but it is not enough for me.(there are 6 pins on mega1280)
Last month, I found the PCINT example from Arduino Playground - PcInt.
I change the code to a library of PCINT, and add Arduino Mega setting in it.
The library is very rough, but it is working.
example1 is change from the PCINT example
example2 is test for read rotary encoder signal by Mega1280, use PJ0(PCINT9 Digital 15) and PJ1(PCINT10 Digital14)
This is first time I write header and code library,I need someone to improve this library and share it to everyone.
If you are the writer of PCINT example, and I impinge your right.
Please tell me, I will delete this article.
PCInterrupt.rar (3.95 KB)