While Loop in an interrupt


hey guys!

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.


Arduino Forum > Using Arduino > Programming Questions > While Loop in an interrupt


arduino

Comments

Popular posts from this blog

Convierte tu Raspberry en un NAS. Firmware fvdw-sl 15.3 - Raspberry Pi Forums

How to format a Get Request

avrdude: verification error, first mismatch at byte 0x0000 0x0c != 0x62