1
我嘗試重新編譯使用PinChangeInt的舊版arduino草圖。編譯器報告以下錯誤:Arduino PinChangeInt.h產生編譯器錯誤
Arduino: 1.6.9 (Windows 7), TD: 1.29, Board: "Arduino/Genuino Micro"
In file included from D:\home\arnold\development\arduino\drone\serial_comm\Rx\Rx.ino:50:0:
C:\packages\arduino\libraries\PinChangeInt/PinChangeInt.h:328:32: error: 'PCMSK1' was not declared in this scope
PCintPort portC=PCintPort(3, 1,PCMSK1); // port PC==3 (also in pins_arduino.c, Arduino version 022)
C:\packages\arduino\libraries\PinChangeInt/PinChangeInt.h:331:32: error: 'PCMSK2' was not declared in this scope
PCintPort portD=PCintPort(4, 2,PCMSK2); // port PD==4
exit status 1
Error compiling for board Arduino/Genuino Micro.
有沒有人知道這裏有什麼問題,以及如何修復這些錯誤?使用Arduino的版本1.6.9,PinChangeInt的版本是2402
謝謝!我正在調查它。如果有效,我會將這個答案標記爲正確。 – Arnold
我知道attachInterrupt,但我被轉向PinChangeInt由http://playground.arduino.cc/Code/ReadReceiver,因爲attachInterrupt只讀取高或低信號,而解碼PWM信號顯然需要變化的信號。這工作正常,直到我不得不再次翻譯代碼,我已經從1.0.5升級到1.6.9。我實現了你的建議,但隨着其他錯誤彈出,我必須確保所有的代碼編譯之前,我確信它一切正常:-) – Arnold
它的工作原理,謝謝! PinChangeInt庫提供了已註釋掉的語句來排除端口。我排除了除portB之外的所有端口,並且這樣做了。 – Arnold