// Test interrupt
const byte ledPin = 13;
const byte interruptPin = 2;
int Buzzpin = 8;
volatile byte state = LOW;
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(interruptPin, INPUT);
attachInterrupt(digitalPinToInterrupt(interruptPin), blink, CHANGE);
}
void loop() {
digitalWrite(ledPin, state);
}
void blink() {
state = !state;
tone (Buzzpin,800,1000);
}