While Loop in an interrupt
hey guys!
got problem interrupt loop:
i strange behaviour:
when press interrupt button, while loop seems loop endlessly without sending serial 'a', if comment out of while (1) loop, serial monitor sends , executes breakson function intended.
any advice here? can't work out.
got problem interrupt loop:
code: [select]
void setup {
attachinterrupt(0, shutdown, rising);
}
void shutdown() {
serial.print('a');
breakson();
while (1) {
serial.print('a');
serial.print(",");
delay(1000);
}
}
i strange behaviour:
when press interrupt button, while loop seems loop endlessly without sending serial 'a', if comment out of while (1) loop, serial monitor sends , executes breakson function intended.
any advice here? can't work out.
http://www.gammon.com.au/interrupts
don't serial prints inside interrupts. don't use delay.
don't serial prints inside interrupts. don't use delay.
Arduino Forum > Using Arduino > Programming Questions > While Loop in an interrupt
arduino
Comments
Post a Comment