arduino-libraries / ArduinoLowPower

Powersave features for SAMD boards
GNU Lesser General Public License v2.1
80 stars 57 forks source link

Serial not working after attachAdcInterrupt #50

Open OriolFalip opened 2 years ago

OriolFalip commented 2 years ago

I'm using a MKR WAN 1310 with the following code:

Serial.print("Battery voltage: ");
Serial.println(analogRead(BATTERY_ANALOG_PIN));
LowPower.attachAdcInterrupt(BATTERY_ANALOG_PIN, lowBatteryVoltage, ADC_INT_BETWEEN, minLowBattery, maxLowBattery);
Serial.println("Can you see me?");

I can see in my console that the battery voltage is printed but any other Serial.print() after attachAdcInterrupt() doesn't print anything.

Is it supposed to be like this? That when you attach the interrupt, Serial no longer works? Is there any other functions that may not work?

aentinger commented 2 years ago

Just for clarity, which core version and which version of the libraries are you using? Can you provide a complete (minimal) sketch?