I'm trying to use the power down state for a battery application, but I'm having issues with the serial communication.
I'm using the lowpower.h
library to put the Arduino Micro into power down mode.
When it wakes I flash an LED, which is working, so I know it's is waking up. And I also re-establish serial communication and send a message. This is not working. I receive nothing on the serial monitor, however the TX LED does flash.
I think the Arduino may be working correctly, but for some reason the serial monitor can't handle it. Perhaps there is a better serial monitor application?
#include "LowPower.h"
void setup()
{
//20sec delay added to make uploading easier (cant upload in power down state)
Serial.begin(115200);
Serial.println("20");
delay(5000);
Serial.println("15");
delay(5000);
Serial.println("10");
delay(5000);
Serial.println("5");
delay(5000);
Serial.println("START");
pinMode(LED_BUILTIN, OUTPUT);
delay(1000);
Serial.end();
}
void loop()
{
// Enter power down state for 8 s with ADC and BOD module disabled
LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
Serial.begin(115200);
delay(100);
Serial.println("BLINK");
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(5000); // wait for a second
Serial.println("BLINK_stop");
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(5000); // wait for a second
Serial.end();
}
Serial monitor output:
20
15
10
5
START
and then nothing...