I'm trying a simple sketch to test interrupts on my DUE. For some reason, when I upload the following sketch, my IDE (Arduino 1.6.8) no longer recognizes the board that is attached. It also doesn't run the main loop. The upload completes successfully and then the board detaches and doesn't run any of the logic it supposedly "uploaded". Any help is appreciated!
#define BTN_MENU_PWR 43
#define LCD_BACKLIGHT 49
void wakeUpNow() {
digitalWrite(LCD_BACKLIGHT, 0);
delay(10000);
SerialUSB.println("Interrupt working!");
}
void setup() {
SerialUSB.begin(9600);
pinMode(BTN_MENU_PWR, INPUT_PULLUP);
attachInterrupt(BTN_MENU_PWR, wakeUpNow, LOW);
SerialUSB.println("Interrupt attached.");
}
void loop() {
analogWrite(LCD_BACKLIGHT, 255);
delay(2000);
analogWrite(LCD_BACKLIGHT, 0);
delay(2000);
}
Moderator edit:
</mark> <mark>[code]</mark> <mark>
</mark> <mark>[/code]</mark> <mark>
tags added.