Hi guys
I have atmega328p-pu running 7/24 continuously sending serial data every 1 sec.
my question is can I use sleep mode and wake up every 1 sec.
Is there any risk to sleep and wakeup processor frequently.
Is that will increase life span for MCU or decrease it.
thanks a lot.
#include <avr/sleep.h>
#include "LowPower.h"
void setup() {
Serial.begin(9600);
Serial.println("starting");
}
void loop() {
static int counter=0;
Serial.println(counter++);
while (!(UCSR0A & (1 << TXC0))); // Wait for the transmission to complete
LowPower.powerDown(SLEEP_1S, ADC_OFF, BOD_OFF);
}