Romeo V2.2 with Interrupt Handler blocks Serial Input

I have written a library that handles the HC-SR04 Sensor using hardware interrupts. This code works fine on UNO and MEGA boards but when I load it on a Romeo V2.2 board it doesn't work at all and it blocks serial input which I use to send commands to the board during testing.
I have tried configuring the code to use PIN 3 with Interrupt 1 or PIN 2 with Interrupt 0, but neither work. Any work around or fix for this problem? Again the code works fine on other boards but hangs on the Romeo.
I have tried configuring the code to use PIN 3 with Interrupt 1 or PIN 2 with Interrupt 0, but neither work. Any work around or fix for this problem? Again the code works fine on other boards but hangs on the Romeo.
2016-04-30 14:07:08 Hi Bob,
if you want to use pin3 on Romeo(leonardo), then it is different from UNO/Mega2560, namely, D3 is interrupt3 instead of interrupt1, you have to use
While on uno, it should be wiring to D3, and the code should be
Board ------------------ Digital Pins Usable For Interrupts (from Arduino)
I think it should be the problem, if I made any mistake, please point me out. Hope it helps.
Leff
if you want to use pin3 on Romeo(leonardo), then it is different from UNO/Mega2560, namely, D3 is interrupt3 instead of interrupt1, you have to use
Code: Select all
attachInterrupt(3, blink, CHANGE); //Leonardo interrupt3, on D3
While on uno, it should be wiring to D3, and the code should be
Code: Select all
attachInterrupt(1, blink, CHANGE); //Uno interrupt1, on D3
Board ------------------ Digital Pins Usable For Interrupts (from Arduino)
- Uno, Nano, Mini, other 328-based 2, 3
- Mega, Mega2560, MegaADK 2, 3, 18, 19, 20, 21
- Micro, Leonardo, other 32u4-based 0, 1, 2, 3, 7
I think it should be the problem, if I made any mistake, please point me out. Hope it helps.
