When I add an interrupt to my code, the MKR is no longer recognized by my development IDE.
I can't even seem to reinstall the bootloader.
Any ideas? - I have 4 MKR now that I can't use.
Here is a code snippet
// the setup function runs once when you press reset or power the board
#define RED_LED 9
#define GREEN_LED 8
#define PB 6
volatile bool m_PB_Down = false;
volatile bool m_B_Down = false;
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(RED_LED, OUTPUT);
pinMode(GREEN_LED, OUTPUT);
pinMode(PB,INPUT);
// TURN ON GREEN LED
//Green_Led_Status(HIGH);
attachInterrupt(digitalPinToInterrupt(PB),PB_ISR, LOW);
}
void loop() {
if (m_PB_Down) {
Red_Led_Status(HIGH);
Green_Led_Status(LOW);
m_PB_Down=false;
}
}
void PB_ISR(){
m_PB_Down = true;
}