New code. Now the ISR only toggles a var. Still does not work.
static const int INTERRUPT_NUMBER = 0;
static const int INTERRUPT_MODE = LOW;
static int mustBeep = 0;
void setup() {
attachInterrupt(INTERRUPT_NUMBER, requestBeep, INTERRUPT_MODE);
}
void loop() {
if(mustBeep){
mustBeep = 0;
beep();
}
}
void beep(){
noTone(7);
tone(7, 440, 1000);
}
//ISR. Must take no parameters and return nothing.
void requestBeep(){
mustBeep = 1;
}